I know how to get the number of symbols in a watch list When I name the watch list in an AFL script. What I'd like is the number of symbols in the default list a rotational back test is using so I can figure percentile ranks, cut offs and the like.
@BBands yes thanks for clarifying your intention. I had posted and deleted a suggestion when it became clear that was your intention. But I also stumbled across a code that I did not think should work to count the number of symbols in a WL that is named in the afl script,
So I thought you may have intended this type of WL creation,
// in AA window, does it mater in the "Apply to *Filter" what is selected?
ETFlist = "VOO, QQQ, IWM, VGK, EWJ, VWO, GSG, GLD, VNQ, HYG, TLT";
nETFlist = StrCount( ETFlist, "," ) + 1;
Filter = Status("LastBarInRange") AND Status( "stocknum" ) == 0;
AddColumn(DateTime(), "Date", formatDateTime);
AddColumn(nETFlist, "# tickers in ETF list");
And when I run an exploration on a WL that contains none of those symbols, I thought it would not work. And yet it appears to work (and this opens up a range of possibilities when writing codes using multiple watch lists).
Here run against the DJIA, a 30 stock WL that does not contain any of the ETF's from my "ETFlist"
No, it does not matter what is set in Filter of analysis window.
Your variables are independent code lines (independent from Analysis Filter). nETFlist just calls ETFlist string variable to count number of its commas. That's all it does. So unsurprisingly nETFlist returns 11.