• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
    https://ninjatrader.com/support/foru...332#post547332
    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 Fiocco, Today, 05:59 AM
        0 responses
        2 views
        0 likes
        Last Post Fiocco
        by Fiocco
         
        Started by Perceivedshift, Today, 05:17 AM
        0 responses
        6 views
        0 likes
        Last Post Perceivedshift  
        Started by herbertmack, Today, 03:19 AM
        0 responses
        5 views
        0 likes
        Last Post herbertmack  
        Started by b16_aln, Today, 03:11 AM
        1 response
        114 views
        0 likes
        Last Post b16_aln
        by b16_aln
         
        Started by Ashley_Mogg, Today, 12:31 AM
        0 responses
        3 views
        0 likes
        Last Post Ashley_Mogg  
        Working...
        X