Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop orders only valid for one bar?

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

    Stop orders only valid for one bar?

    Hi,

    I am experiencing a strange issue with EnterShortStop() and EnterLongStop() orders.
    I have just spotted that, when backtesting my strategy (historical data from MBT, EUR/GBP, 15min), my orders only seem to be valid during the bar AFTER the order is made.
    Here is my code for entry orders;

    EnterLongStop(10000,High[0] + (5 * TickSize));
    EnterShortStop(10000, Low[0] - (5 * TickSize));

    If my order price is not reached in the following bar then it never gets filled.

    ExitOnClose = false and GTC = true. What am I doing wrong?

    Thanks!
    Attached Files

    #2
    This would be expected default behavior in NT - if you don't resubmit it it would expire on the next bar, same would hold true for Limit / StopLimit orders - instead of resubmitting you could also use the more advanced overload to set liveUntilCancelled to true - then the orders would persist until being cancelled or filled.

    Comment


      #3
      Thanks Bertrand, that fixed it. :-)

      So, why wouldnt GTC set to true in the backtest options not do the same thing?

      Comment


        #4
        BillyRayValentine, the order expiration is different from the default behavior of the orders (to cancel after one bar), but it is a good question.
        AustinNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        64 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