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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        67 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        36 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        60 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X