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 suroot, 02-25-2017, 04:43 AM
        11 responses
        2,548 views
        0 likes
        Last Post Zilvercat  
        Started by Rogers101, 05-05-2024, 11:30 AM
        16 responses
        50 views
        0 likes
        Last Post Rogers101  
        Started by ninza33, Today, 12:31 PM
        2 responses
        10 views
        0 likes
        Last Post ninza33
        by ninza33
         
        Started by Bobin, 03-12-2024, 08:51 AM
        15 responses
        482 views
        0 likes
        Last Post fiddich
        by fiddich
         
        Started by Skifree, Today, 11:21 AM
        4 responses
        15 views
        0 likes
        Last Post Skifree
        by Skifree
         
        Working...
        X