Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

"OCO ID can not be reused: Please use a new OCO ID" Error

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

    "OCO ID can not be reused: Please use a new OCO ID" Error


    I'm having a hard time diagnosing this error. In my strategy, my code is:

    if (Position.MarketPosition == MarketPosition.Flat) entryOrder = null;
    if ( (entryOrder == null) && ( (My Setup Condition == true) ) {
    SetStopLoss(CalculationMode.Ticks, 4);
    SetProfitTarget(CalculationMode.Ticks, 4);
    entryOrder = EnterLongLimit(0, false, ...");
    }

    Then, I get into a trade, but the Stops and Profit targets are ignored, and the trade never closes This occurs rarely, and seemingly randomly.


    Any thoughts on this? Thanks for your help,


    Attached Files
    Last edited by timmbbo; 04-27-2021, 10:59 PM.

    #2
    Hello timmbbo,

    Thanks for your post.

    Did you also see a message about the stoploss order being rejected?

    If the stoploss order was rejected that would invalidate the OCO ID and cause the OCO id error.

    You may want to check the "Log" tab of the control center when these errors occur.

    Comment


      #3
      You can also find another solution here: https://ninjatrader.com/support/foru...ort-aa/1101528

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      80 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      66 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X