Hello to all,

I would greatly appreciate help with creating an exploration that 
loops through a watchlist to build a correlation matrix.  If 
Correlation(Ticker1, ticker2,256) >=.75 add ticker 1 to watchlist1 
addticker2 to watchlist2 and writes each pair out to a csv file with 
the following info:

Date, Ticker1, ticker2, Correlation, Correlation periods.

All of my attempts to modify the correlation matrix off the amibroker 
website have failed (see code bellow).  This is well beyond my 
capabilities so thank you in advance for any assistance.

Regards

Jeremy

WLNum = Param("WatchList Number",27,0,500,1);
CorrPd = Param("Correlation Period",1000,1,5000,1);
list = GetCategorySymbols( categoryWatchlist, WLNum);
SetOption("NoDefaultColumns",True);
Filter = Status("LastBarInTest");
SetSortColumns( 1 );
AddTextColumn(Name(),"Correlation",1.0);
Ticker1= Name();
for( Col=0; (Ticker2=StrExtract( List, Col))!= ""; Col++)
{
Var2 = Foreign(Ticker2,"C");
Corr = Correlation( C, Var2, CorrPd);
Color = IIf(Corr>0, colorBrightGreen, IIf(Corr<0, 
colorRed,colorWhite));
Color = IIf(Ticker1==Ticker2, 1, Color);
AddColumn( Corr, Ticker2, 1.3, 1, Color);
}


Reply via email to