NexusFi: Find Your Edge


Home Menu

 





Multi-instrument code strategy


Discussion in NinjaTrader

Updated
    1. trending_up 2,283 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?
I Have a Thing Called Iran -- Trump Stays in DC as Airsp …
Prediction Markets & Event Contracts
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
Fed Hike Odds at 57% After Warsh: England Surges 12.9%, …
Prediction Markets & Event Contracts
Warsh Confirmed 54-45 on PPI Day -- 97% Say He Holds in …
Prediction Markets & Event Contracts
Hormuz Completely Closed: US Strikes Day 2, Iran Shoots …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
13 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 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,427


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