NexusFi: Find Your Edge


Home Menu

 





Multi-instrument code strategy


Discussion in NinjaTrader

Updated
    1. trending_up 2,193 views
    2. thumb_up 1 thanks given
    3. group 1 followers
    1. forum 1 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
Astrogirl
Milan/Italy
 
Posts: 51 since Oct 2013
Thanks Given: 25
Thanks Received: 12

Does anyone know how translate in NT language scripting what follows in the same unique strategy?

if it's 10.00am buy one contract of YM;
if it's 11.00am buy one contract of ES;


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NYSE Owner ICE Invests in Crypto Exchange OKX at $25 Bil …
Cryptocurrency
Orban at 29pct as Hungary Votes Tomorrow -- McIlroy Surg …
Prediction Markets & Event Contracts
April 2026 Jobs Report: +115k vs +65k Expected
Traders Hideout
Saylors 41-Month HODL Breaks: Strategy Sells 32 BTC as $ …
Prediction Markets & Event Contracts
Iran Peace Expired NO: Ceasefire on Life Support, OPEC a …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #2 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,550 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,430


Astrogirl View Post
Does anyone know how translate in NT language scripting what follows in the same unique strategy?

if it's 10.00am buy one contract of YM;
if it's 11.00am buy one contract of ES;

Roughly speaking you need to add the extra instrument series in the Initialise method, then trigger your longs in the OnBarUpdate, e.g.

 
Code
// in Initialise, assuming you are running the strategy on some other chart series

Add ("YM 06-14", PeriodType.Minute, 1);
Add ("ES 06-14", Periodtype.Minute, 1);

// in OnBarUpdate

if (FirstTickOfBar && BarsInProgress == 1 && Time[0].Hour == 10 && Time[0].Minute == 0) { EnterLong .... }

if (FirstTickOfBar && BarsInProgress == 2 && Time[0].Hour == 11 && Time[0].Minute == 0) { EnterLong .... }
Obviously, lots of other stuff to take care of, just work through the Ninja strategy doc and any detailed examples you can find, hope it helps you get started, you'll probably find lots of full examples on here somewhere.


Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on April 14, 2014


© 2026 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 - Downloads - Top
no new posts