Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

StopLoss with Multi-Time Frame Strategy

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

    StopLoss with Multi-Time Frame Strategy

    Hello NT Support,

    I develop a strategy with one instrument, day bars and minute bars. I use stop loss orders.

    The orders with minute bars depend on orders with day bars. Since day and minute bars are with one and the same instrument, I use OnExecution method and string variables to track market positions.

    I need to know where StopLoss order is executed - on day bars or on minute bars. How can I know it?

    Thanks

    #2
    Valyo, I would suggest 'tagging' the BarsInProgress you submit to / on with the signal name of your orders, you can then in turn check this property of the IOrder processed by other parts of your code.

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Valyo, I would suggest 'tagging' the BarsInProgress you submit to / on with the signal name of your orders, you can then in turn check this property of the IOrder processed by other parts of your code.
      Bertrand, this doesn't work.
      I used

      Code:
      Print(execution.ToString());
      Print(execution.Order.FromEntrySignal);
      to debug the script.

      Here is the output for regular exit order:

      Execution='NT-00380' Instrument='$AUDNZD' Account='Backtest' Name='Exit Minute Long' Exchange=Default Price=1,2044 Quantity=0,1M Market position=Short Commission=0 Order='NT-00571' Time='4.6.2013 г. 23:00 ч.' Multiplier=1E-05
      Enter Minute Long
      Here "Enter Minute Long" is FromEntrySignal.

      Here is the output for stop loss order:

      Execution='NT-00381' Instrument='$AUDNZD' Account='Backtest' Name='Stop loss' Exchange=Default Price=1,195 Quantity=0,1M Market position=Short Commission=0 Order='NT-00565' Time='5.6.2013 г. 15:00 ч.' Multiplier=1E-05
      There is no FromEntrySignal, just a blank line. It seems I cannot access FromEntrySignal with Stop loss orders. Is there another way to track entry orders?

      Comment


        #4
        Hello,

        Are you currently using SetStopLoss() to place your stop loss orders? If so keep in mind that the set methods only get applied to the primary series for the instrument.

        Is there a simple sample script that you can post which replicates the issue you're seeing?
        LanceNinjaTrader Customer Service

        Comment


          #5
          Yes, I am using SetStopLoss. My primary series is with minute bars and the additional series is with day bars. How can I apply stop loss to the additional series for the instrument?

          Comment


            #6
            Hello,

            In this case you will not be able to use SetStopLoss()

            You will have to use IOrders for your order tracking.

            This is a good starting guide and example if you haven't worked with IOrders before. It shows how you can apply your exit orders in OnExecution(): http://www.ninjatrader.com/support/f...ead.php?t=7499

            Let me know if I can be of further assistance.
            LanceNinjaTrader Customer Service

            Comment


              #7
              OK, thank you. I will check it.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              648 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              369 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              108 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              573 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              575 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X