Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy constantly cancelling and replacing order

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

    Strategy constantly cancelling and replacing order

    I have a strategy that enters the market via Limit Order at a moving average.

    As the strategy is set to calculate on each tick, it appears the strategy is constantly canceling an order then reentering it - even though the limit price has not changed

    Is this normal? Is there a way to stop this from happening?


    if (Signal[1] > 0 && Close[0] >= KeltnerEMAChannelTrend(4, 1.5, 21).Midline[0] )
    if(Position.MarketPosition == MarketPosition.Flat) // allows only 1 trade per direction
    EnterLongLimit(1,KeltnerEMAChannelTrend(4, 1.5, 21).Midline[0], "ZLRe1");

    #2
    Hello RodS7,
    If a limit order is not filled on the bar to which it was submitted then the order is cancelled unless it is explicitly told not to do so. You can tell it by using the below overload and setting the liveUntilCancelled property to true.

    EnterLongLimit(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double limitPrice, string signalName)


    Please modify your code as per below and see if the order remains live or not.
    Code:
    if (Signal[1] > 0 && Close[0] >= KeltnerEMAChannelTrend(4, 1.5, 21).Midline[0] )
    if(Position.MarketPosition == MarketPosition.Flat) // allows only 1 trade per direction
    EnterLongLimit(0, true, 1, KeltnerEMAChannelTrend(4, 1.5, 21).Midline[0], "ZLRe1");
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      That did it - thanks again

      Is there somewhere that lists all functions that I need to address using "barsInProgressIndex" on MTF indicators / strategies?

      Comment


        #4
        Hello RodS7,
        Glad to know everything is working fine at your end.

        To know more about BarsInProgress please refer to our help guide here


        To know more about multi-series, please refer here


        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        656 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        371 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        579 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X