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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        633 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        567 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X