NexusFi: Find Your Edge


Home Menu

 





Multi-instrument code strategy


Discussion in NinjaTrader

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




 
Search this Thread

Multi-instrument code strategy

  #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?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
Quant vue
Trading Reviews and Vendors
REcommedations for programming help
Sierra Chart
 
  #2 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,426


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


© 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