I would like to scan a list of ETF symbols. Therefore, when a new symbol is iterated, I expect to reset all the calculations from the previous symbol as a fresh start.
E.g. I have three symbols: SPY, QQQ, IWM, for each I want to use its SMA calculation result to calculate a range that I may be interested.
The question is that how to reset the symbol in code, so that after SPY is done, all the calculations (SMA, RSI, etc.) reset to QQQ, and so forth for the rest of the list.
Please help. Thanks.
Size:
Color:
I tried to use the DataSet on the left, so that it back tests all the ETF I specified there. I think this is Ok for me. But I still wonder if I can do this in the code (i.e. iterating all symbols), so that I can get a collection of results from all the symbols and further work on them.
Size:
Color:
If I get your question correctly, this is accomplished with looping by DataSetSymbols. There are lots of examples on the forum, Wiki, QuickRef and in downloadable Strategies such as those in Symbol Rotation folder (from "Open Strategy" dialog in WLP, click "Download...").
Size:
Color:
Thank you Eugene. I downloaded the strategies and this looks impressive and is really helpful!
Size:
Color:
You're welcome.
Size:
Color: