Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Trade a future based on a trigger of the index.
Collapse
X
-
Trade a future based on a trigger of the index.
I want to trade a future based on a trigger of the index. If the index reaches a triggerlevel I want to execute a market order for a future. If I understand correctly EnterLongStop is only able to use triggerdata for entering the market for the same product. Is there a solution to thisTags: None
-
Hello Renejm,
Thank you for your note and welcome to the NinjaTrader Support Forum!
This is possible through the use of the BarsInProgress Index after adding the additional data series (instrument) to your strategy.
For information on Multiple Instruments and Time Frames in your strategy please visit the following link: http://www.ninjatrader.com/support/h...nstruments.htm
In addition, for an example of using multiple instruments in a strategy please go to your NinjaTrader Control Center > Tools > Edit NinjaScript > Strategy > SampleMultiInstrument > OK.
Please let me know if I may be of further assistance.
-
Thanks for the reply. I have used the BarsInProgress already, but so far I am not able to accomplish what I am looking for. I will explain in a simple example: I am using the DAX index as strategy/graph and I want to enter the market with a DAX future. I want to go long on the current bar if the DAX index is higher than the high of the previous bar of the DAX index. The action should be EnterLong at market price for the DAX future. Addional I want to exit the position usnig a stoploss on the DAX index (and not on the future). So the index is leading in generating the signals. Is this possible by using the functions EnterLongStop and SetStopLoss together with BarsInProgress or does the stopprice refer to the DAX future and not the DAX index?
Comment
-
Hello Renejm,
Thank you for your response.
You would use the barsInProgress Index within the EnterLong() method, such as the following:
For information on entering on a different barsInProgress Index then your calculation please visit the following link: http://www.ninjatrader.com/support/h...r_handling.htmCode:if(BarsInProgress == 1) // This says process the following calculation on the ^DAX I have entered in the Initialize() method. { if(High[0] > High[1]) { EnterLong(0, 1, "Long"); // We now enter long on the 0 barsInProgress Index which is the instrument the strategy is applied to. } }
For the SetStopLoss(), are you dynamically updating the Stop Loss in the OnBarUpdate() method or only setting it once in the Initialize() method?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
647 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
369 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
572 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment