Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trade a future based on a trigger of the index.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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 this

    #2
    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.

    Comment


      #3
      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


        #4
        Hello Renejm,

        Thank you for your response.

        You would use the barsInProgress Index within the EnterLong() method, such as the following:
        Code:
        			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 information on entering on a different barsInProgress Index then your calculation please visit the following link: http://www.ninjatrader.com/support/h...r_handling.htm

        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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        66 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        149 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        99 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        286 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X