NexusFi: Find Your Edge


Home Menu

 





Multi-instrument code strategy


Discussion in NinjaTrader

Updated
    1. trending_up 2,345 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?
Thanks Mike. Godspeed.
The Elite Circle
Without Pulisic, USA 61.5% Live vs. Australia -- France …
Prediction Markets & Event Contracts
Datafeed for Atas
Platforms and Indicators
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
Daytrading to swingtrading
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
Denied 20K payouts: Alpha Futures
1 thanks
FootPrintV2 Chart for NT8
1 thanks
BERN ALGOS algo trading journal
1 thanks
Afternoon-close session
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