Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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

    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 Vitamite, Yesterday, 12:48 PM
      3 responses
      17 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by aligator, Today, 02:17 PM
      0 responses
      10 views
      0 likes
      Last Post aligator  
      Started by lorem, 04-25-2024, 09:18 AM
      22 responses
      94 views
      0 likes
      Last Post lorem
      by lorem
       
      Started by sofortune, Today, 10:05 AM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by ETFVoyageur, 05-07-2024, 07:05 PM
      23 responses
      185 views
      0 likes
      Last Post ETFVoyageur  
      Working...
      X