PDA

View Full Version : Strategy on a list of instrument


PulseFive
10-25-2009, 07:38 AM
I am currently coding my own strategy which works on a basket asset, but I

don't find any insight about the way strategy works on multiple instruments in

the Help Guide ...

For instance : EnterLong(300, "Buy")

What it is the corresponding code when we have an instrument list of 5 assets in the strategy ?

NinjaTrader_Austin
10-25-2009, 01:25 PM
PulseFive, the help guide contains all the information you need for multi-instrument strategies.

Here is a link to the main multi-instrument page (http://www.ninjatrader-support.com/HelpGuideV6/MultiTimeFrameInstruments.html).
In this link (http://www.ninjatrader-support.com/HelpGuideV6/EnterLong.html), take a look at the BarsInProgress portions.

Basically, you need to specify an additional argument (BarsInProgress - the "instrument index") for your entries:

// to submit an order for the 1nd instrument:
EnterLong(0, 300, "Buy");
// to submit an order for the 2nd instrument:
EnterLong(1, 300, "Buy");
// to submit an order for the 4th instrument:
EnterLong(3, 300, "Buy");