Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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.
Thanks
Can you help answer these questions from other members on NexusFi?
It can be done, but why 100 stocks? Why not 1000?
Seriously, you understand that for this strategy to be profitable it has to be profitable at least on 1 instrument.
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?
NT loads all the bars needed. So its not what n is, as how many bars.
So if you load 3 days of daily data, you should be able to load even 10000 instruments.
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).
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