NexusFi: Find Your Edge


Home Menu

 





Multi-instrument strategy


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one jnorris with 5 posts (1 thanks)
    2. looks_two baruchs with 3 posts (1 thanks)
    3. looks_3 slamdunk73 with 2 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 9,046 views
    2. thumb_up 6 thanks given
    3. group 5 followers
    1. forum 14 posts
    2. attach_file 0 attachments




 
Search this Thread

Multi-instrument strategy

  #1 (permalink)
 jnorris 
Charlotte, NC
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 8 since Jun 2013
Thanks Given: 2
Thanks Received: 1

Hello,

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

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Exit Strategy
NinjaTrader
Better Renko Gaps
The Elite Circle
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
38 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
GFIs1 1 DAX trade per day journal
19 thanks
The Program
18 thanks
  #3 (permalink)
 baruchs 
Israel
 
Experience: Intermediate
Platform: NinjaTrader
Broker: pfg
Trading: eminis
Posts: 323 since Jun 2009


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.

Reply With Quote
  #4 (permalink)
 jnorris 
Charlotte, NC
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 8 since Jun 2013
Thanks Given: 2
Thanks Received: 1


baruchs View Post
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").

Started this thread Reply With Quote
  #5 (permalink)
 baruchs 
Israel
 
Experience: Intermediate
Platform: NinjaTrader
Broker: pfg
Trading: eminis
Posts: 323 since Jun 2009

Just add instruments in Initialize.
That's all.

Reply With Quote
  #6 (permalink)
 vegasfoster 
las vegas
 
Experience: Intermediate
Platform: Sierra Chart
Broker: Velocity/IB
Trading: 6E
Posts: 1,145 since Feb 2010
Thanks Given: 304
Thanks Received: 844

I've not tried it, but I'm thinkin NT is not right for that application due to performance issues.

Reply With Quote
  #7 (permalink)
 jnorris 
Charlotte, NC
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 8 since Jun 2013
Thanks Given: 2
Thanks Received: 1

@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?

Started this thread Reply With Quote
  #8 (permalink)
 baruchs 
Israel
 
Experience: Intermediate
Platform: NinjaTrader
Broker: pfg
Trading: eminis
Posts: 323 since Jun 2009


jnorris View Post
@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.
Usually I do not speculate when I answer questions.
@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.

Reply With Quote
  #9 (permalink)
 jnorris 
Charlotte, NC
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 8 since Jun 2013
Thanks Given: 2
Thanks Received: 1


baruchs View Post
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).

Started this thread Reply With Quote
  #10 (permalink)
 
Zondor's Avatar
 Zondor 
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
Posts: 1,333 since Jul 2009
Thanks Given: 1,246
Thanks Received: 2,731


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
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote




Last Updated on February 4, 2014


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts