I am running the following code (which I did not write)to create a correlation matrix with an exploration. It works great.
What I want AB to do next though is to sift out all the symbols that that meet a certian criteria and put them in a new watchlist. ie. Sift or pool all symbols that have a correlation < .05 and > - .05. and catagoreyaddsymbol function them into a new watchlist. Can anybody lend a hand? Thank you!!! Here's the Matrix code... /*This is the formula to create a correlation matrix in AB. It is set up to run the correlation of the symbols in Watchlist 2 with the "define" filter catagory in the auto-analyser. In this default case this code will correlate the symbols in watchlist 2 with the symbols in watchlist 2. - Tools -> Send to Analysis - press FILTER button and select Watchlist 2 in INCLUDE tab - press EXPLORE button in AA window.*/ /*This retrieves a comma-seperated list of symbols belonging to watchlist 2*/ symlist = CategoryGetSymbols( categoryWatchlist, 2 ); /*"Filter"controls which quotes are accepted, if 1/true is assigned to that variable for a given symbol/quote it will be displayed in the report. "Status" returns run-time status of the analysis engine. "Lastbarinrange" returns a 1(or true) on the last bar of the analysis range*/ Filter = Status("lastbarinrange"); /*"StrExtract" exracts a given item (substring from a comma-seperated list of items. This "for" statement says to pull the first symbol in the "symlist" that is not = to a blank space.*/ for( i = 0; ( sym = StrExtract( symlist, i ) ) != ""; i++ ) { /*"Run a 252 day correlation of the current symbol's close " */ Corr = Correlation( C, Foreign( sym, "C" ), 252 ); /*Color things real pretty like.*/ Clr = 32 + SelectedValue( Corr ) * 32; AddColumn( Corr, sym, 1.2, ColorHSB( 128+Clr, 255, 255 ) , ColorHSB( Clr, 255, 255 ) ); }