How to scan a list of ETFs?
Author: cheers32
Creation Date: 3/14/2017 6:30 PM
profile picture

cheers32

#1
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.
profile picture

cheers32

#2
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.
profile picture

Eugene

#3
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...").
profile picture

cheers32

#4
Thank you Eugene. I downloaded the strategies and this looks impressive and is really helpful!
profile picture

Eugene

#5
You're welcome.