[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Calculating Correlation



PureBytes Links

Trading Reference Links

Quite easy.  Open IYR, put the symbol for SPX into "symbol" or the parameter 
box,  and choose the period.  If you want r^2, just square stdCorr.

symbol = ParamStr("Symbol", "SPX");

periodCorr = Param("Correlation Period", 300, 3, 500, 1);

stdCorr = Correlation(C, Foreign(symbol, "Close"), periodCorr);

Plot(stdCorr, "stdCorr", colorRed);

----- Original Message ----- 

From: "longarm61" <norm1@xxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Wednesday, June 14, 2006 1:13 PM
Subject: [amibroker] Calculating Correlation


>
> Hello,
>
> I would simply like to calculate the correlation between
> various ETFs in my stable against the S&P 500.  How, for
> example, would I get the correlation for IYR against SPX.X,
> going back 300 days?  I've looked at the AFL formula for
> Correlation and I've dug through some posts on this group,
> but I still can't figure out exactly how to do it, being a
> complete AFL doofus.  If someone would be kind enough to
> post the code and briefly tell me how to initiate it, I
> would greatly appreciate it.
>
> Thanks!
>
> NH
>
>
>
>
>
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.394 / Virus Database: 268.8.4/363 - Release Date: 06/13/06
>
>