Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Some limit orders are getting cancelled

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

    Some limit orders are getting cancelled

    Why are some of my limit orders getting cancelled? This is causing my backtest strategies to lose lot's of money as it won't take a loss sometimes.
    • I have Historical fill processing set to High and on 1 Tick, see photos below
    • I don't use SetStopLoss and SetProfitTarget, instead I use EnterLimit() for entries and ExitLimit() for exits


    Here is my example of my stop loss code :

    Code:
    if (Low[0] <= nearest+1.5d)
    {
        ExitLongLimit(1, true,quantity,nearest + 1.5d, "Exit Long Prediction Points","Long Prediction Point");
    }

    #2
    Hello JakeOfSpades,

    The orders will remain alive as long as they continue to be resubmitted, unless isLiveUntilCancelled is true.

    Below is a link to a forum post that discusses this.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea, so I am using IsLiveUntilCancelled = true . Is it because I am resubmitting orders in OnBarUpdate()?

      Comment


        #4
        Hello JakeOfSpades,

        Thanks for your reply.

        Please check the "log" tab of the NinjaTrader control center when you run your strategy for any error messages that may provide further information.

        Please check your code for any other exit methods used and ensure that they all have bool IsLiveUntilCancelled set to true.

        If you are using CancelOrder() anywhere in your code you may want to add Print statements to print when that method is called and see if that lines up.

        You can always enable TraceOrders in your strategy. https://ninjatrader.com/support/help...raceorders.htm

        Here is a link to further debugging tips: https://ninjatrader.com/support/help...script_cod.htm

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        87 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        55 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        116 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        194 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        176 views
        0 likes
        Last Post CarlTrading  
        Working...
        X