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

  #11 (permalink)
 
shodson's Avatar
 shodson 
OC, California, USA
Quantoholic
 
Experience: Advanced
Platform: IB/TWS, NinjaTrader, ToS
Broker: IB, ToS, Kinetick
Trading: stocks, options, futures, VIX
Posts: 1,976 since Jun 2009
Thanks Given: 533
Thanks Received: 3,709

To address your specific example, just add each instrument, as specified, but they all have to be on the same time frame as the primary instrument. So if you're trading AAPL on 5min bars, for example, and you also want to trade Intel, Cisco, Oracle, Microsoft, then you just add them in OnInitialize()

 
Code
Add("INTC", PeriodType.Minute, 5);
Add("CSCO", PeriodType.Minute, 5);
Add("ORCL", PeriodType.Minute, 5);
Add("MSFT", PeriodType.Minute, 5);
However, multi-instrument strategies are more appropriate when you want to trade one specific instrument, but you want to examine another instrument to make decisions, like trading SPY while watching the VIX.

Or, another typical scenario is if you want to examine or trade the same instrument but on a different time frame, like trade the SPY on a 15min time frame but decide when to enter/exit based on price action on the 3min time frame.

As for your example, I would just create one strategy for one insturument and then run multiple instances of the strategy, one for each instrument. This decouple's the strategies from trying to manage multiple instruments, which is more complicated, and just dedicates one strat per stock. Also, you can more easily backtest a group of stocks like the DOW 30 or the entire S&P 500 by just running a test across an entire instrument group without having to change code every time you want to test different instruments.

As far as looking for some examples, see the SampleMultiInstrument strategy that comes with Ninjatrader. Also, make sure you go through this topic on multiple instruments at NT's site a few times.

Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Futures True Range Report
The Elite Circle
Build trailing stop for micro index(s)
Psychology and Money Management
ZombieSqueeze
Platforms and Indicators
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 …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
22 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #12 (permalink)
 jnorris 
Charlotte, NC
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 8 since Jun 2013
Thanks Given: 2
Thanks Received: 1

@shodson Fantastic info, thanks! This is exactly what I was looking for including pointers on what to study next.

Started this thread Reply With Quote
Thanked by:
  #13 (permalink)
 slamdunk73 
Irvine CA/USA
 
Experience: Intermediate
Platform: NinjaTrade,Amibroker,Tradelink
Trading: Stocks
Posts: 3 since May 2013
Thanks Given: 1
Thanks Received: 1


One of the big advantage on running a portfolio of symbols in the same strategy is that you can use portfolio statistics. For example, you can

1) Exit the strategy when the P/L reach a limit for all the symbols.
2) You can limit the number of trades for the entire list of symbols.
3) You can limit how much money the strategy will buy/sell.

If I had a portfolio of 100 symbols, would managing them in the strategy be difficult ? Sounds like a simple feature NT should have. Amibroker and Tradelink works at the portfolio level, not at the symbol level.

Anyone having any success with this ? Thanks.

Andy

Reply With Quote
  #14 (permalink)
 
Adamus's Avatar
 Adamus 
London, UK
 
Experience: Beginner
Platform: NinjaTrader, home-grown Java
Broker: IB/IQFeed
Trading: EUR/USD
Posts: 1,085 since Dec 2010
Thanks Given: 471
Thanks Received: 789

Yes exactly, it's a definite missing feature in Ninja and it's not going to be in NT8 either. Guess they decided it wasn't in their interests to code it - maybe it was too much of a night to fit it into their application architecture, and not enough people demand it.

It is not difficult to code multi-instrument strategies. It's not a big deal at all if you already coding multi-time-frames, but it's not facile. You have to be rigorous and it's all extra work, compared to doing portfolio management through a GUI by using a mouse to select a portfolio of strategy-instrument pairs (which is presumably what NT's competition allows you to do).

You can discover what your enemy fears most by observing the means he uses to frighten you.
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #15 (permalink)
 slamdunk73 
Irvine CA/USA
 
Experience: Intermediate
Platform: NinjaTrade,Amibroker,Tradelink
Trading: Stocks
Posts: 3 since May 2013
Thanks Given: 1
Thanks Received: 1

I found a solution to running multiple instruments strategy and using portfolio statistics. Run a simple strategy per symbol but have them all read/write to a shared text file. Thus, you can put portfolio type information into this file. Be very careful on how often and how much you read/write to this file. I was able to run a 200 symbols strategy with no problem.

Andy

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