I have a pairs trading script where one of the symbols is hard-coded, e.g.
CODE:
Please log in to see this code.
I have a list of pairs and I want to examine the strategy's equity curve for each pair, one by one. My first thought was to create a dataset with fake symbols, like "ABC-DEF" and "ABC-GHI" and inside the strategy parse the fake symbol into its two parts. That doesn't work of course b/c entering "ABC-DEF" as a symbol gives you "No Data Available" before the strategy even runs.
Any suggestions or ideas for easily viewing the equity curve for a list of pairs without having to change & recompile the code each time?
Thanks,
Jared
Size:
Color:
Out of the many possibilities, one obvious one is to fill a
Dictionary< string,string > with your pair symbols and look up the corresponding symbol's name as
yourDictionary[Bars.Symbol].
Size:
Color:
Thanks. I went down that route and the problem I ran into is for a given symbol, there are often more than one other symbols I want to pair with it. For example, I want to check out the equity curve for StockA,StockB. Then StockA,StockC.
Size:
Color:
Off the top of my head: you could create a custom data structure that returns a List< string > for a given symbol, and then set up a StrategyParameter (integer) tied to the List.Count. Then it would be a matter of scrolling to select another symbol for the pair. And to not lose track of the pair, it could be drawn on the PricePane.
Size:
Color: