Can someone please point me to a strategy example that uses multiple instruments? More specifically, let's take the example "SampleMACrossOver" that comes with NT7: What if I want to extend this strategy to run against, say 100 different stocks? Is there a way to programmatically approach this? For example, let's say at Time X, 5 of the 100 stocks have potential buy points, I want to process those hits further in code.
The actual strategy here isn't important, rather I'm just looking for a code example that considers many instruments at once.
Agreed, I don't care about the number (I'm sure I'd eventually parameterize it). Rather, I'm just trying to learn how to write a multi-instrument strategy of this structural type, so I'm just making a simple, contrived example that highlights my question. (For this same reason, profitability is not a concern as this is a toy example for learning).
(Eventually, instead of inputting 100 or 1000 stocks to the strategy, the input would be generated by a programmatic "screen").
@baruchs thanks, you may be right - it may be that simple. I suspect I can make my instrument "Add() generators" as simple/complex as the environment (ie: C#) allows.
@vegasfoster I suspect this would be a problem if n got too large; however for my needs n is going to be relatively small. I wonder how many instruments people have successfully Add()'ed to a single strategy?
Each instrument added (ie: n), will have different bar data, therefore 10000 instruments would mean there are 10000 different bar data series to build, no? (However, I agree, more bars (eg: changing from daily -> 1min) is a very significant (maybe more) scaling factor, but it's a different n I think).
Favorite Futures: Gameplay Klownbine® Trading of Globex
Posts: 1,276 since Jul 2009
Thanks: 1,227 given,
Anything is possible, what do you have in mind?
You can do whatever you want with multiple instruments.
Just to give one example, they can be combined in real time into custom indexes synchronized to the master instrument of a chart.
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett