Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Trading micro contracts on a mini contract-based strategy
Collapse
X
-
Trading micro contracts on a mini contract-based strategy
Hello, I have a strategy that utilizes order flow obtained from the mini contracts chart (nq, es, etc.), however I would like to enter trades using micro contracts with the same strategy. How can I do this?Tags: None
-
Hello rbeckmann05,
Thank you for your note.
Add the data series of the other instrument with AddDataSeries(). (for example AddDataSeries("MES 12-23")
This added series becomes BarsInProgress index 1. (while the primary series is BarsInProgress index 0)
Choose the BarsInProgress you want OnBarUpdate() to process logic on.
Call the order method and supply the BarsInProgressIndex of the instrument you want the order to go to.
EnterLong(int barsInProgressIndex, int quantity, string signalName)
Included with NinjaTrader is the SampleMultiInstrument which demonstrates.Chelsea B.NinjaTrader Customer Service
-
Awesome, just what I'm looking for, thank you. Does this mean I need to add (If barsInProgress == 0) to the rest of the code, or should it be all good as is?
Comment
-
Hi Chelsea,
Is using Strategy Builder, do I add the additional data series using the Additional Data function or the custom series function? If using Additional Data function, do I click the Use primary instrument box? As I am using Renko type of bar, I should choose Tick as Type right and do I leave the value as the default 1? After all these, do I just need to enable the strategy on a Mini chart and it will trade on the Micro contract? Thank you,
Comment
-
Hello Invest78,
The Strategy Builder cannot send orders to an added instrument series.
The Additional Data adds a price series of the same or a different instrument.
The Custom series is an empty Series<T> that allows you to save your custom values for each bar.
'Use primary series' will cause the added price series to have the same instrument as the chart.
In an unlocked script with a price series of a different instrument added, the barsInProgressIndex of that series must be supplied to the order method.Chelsea B.NinjaTrader Customer Service
Comment
-
-
Hi rbeckmann05, rbeckmann05 That is so nice of you. Yes, I would like to do the same thing like you, basing a strategy off mini data and entering with micro. Do you happen to know how to modify your code since I am using a custom Renko bar on my chart. Thank you.
Comment
-
-
Invest78 Here you go, hope this helps! Make sure to copy and paste the parameters, the "entryIndex" variable declaration right above OnStateChange(), the additional data series in the State.Configure() section, and those two EnterLong/EnterShort calls in replacement for what you already have for entry and you should be all set. If you have any questions please feel free to let me know!Attached Files
Comment
-
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by marcus2300, Yesterday, 10:21 AM
|
6 responses
19 views
0 likes
|
Last Post
by marcus2300
Today, 01:53 AM
|
||
Started by skorpn, Today, 01:28 AM
|
0 responses
7 views
0 likes
|
Last Post
by skorpn
Today, 01:28 AM
|
||
Started by ETFVoyageur, Today, 12:52 AM
|
0 responses
6 views
0 likes
|
Last Post
by ETFVoyageur
Today, 12:52 AM
|
||
Started by Board game geek, Yesterday, 02:20 AM
|
2 responses
22 views
0 likes
|
Last Post Today, 12:30 AM | ||
Started by jackiegils, Yesterday, 11:05 PM
|
0 responses
7 views
0 likes
|
Last Post
by jackiegils
Yesterday, 11:05 PM
|
Comment