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
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DynamicTest, Today, 11:18 PM
        0 responses
        3 views
        0 likes
        Last Post DynamicTest  
        Started by dcriador, Today, 01:43 AM
        3 responses
        19 views
        0 likes
        Last Post dcriador  
        Started by smartromain, Today, 10:50 PM
        0 responses
        5 views
        0 likes
        Last Post smartromain  
        Started by popecapllc, 08-09-2023, 07:42 PM
        10 responses
        1,366 views
        0 likes
        Last Post BartMan
        by BartMan
         
        Started by jbays87, Today, 09:46 PM
        0 responses
        6 views
        0 likes
        Last Post jbays87
        by jbays87
         
        Working...
        X