Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Please use a new OCO ID

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

    Please use a new OCO ID

    every time I try and place an order it tells me "The OCO ID cannot be reused." What do I need to do?

    #2
    Hello,

    Thank you for your post.

    For your inquiry, this means that you have OCO mode enabled and the original OCO order was canceled. Press Control+z on your keyboard to turn off OCO mode, you should see a small green "OCO" icon get disabled when you do this.

    Stop loss and profit target orders (submitted automatically via an ATM strategy) are always sent as OCO, however, you can submit entry or exit orders as OCO orders as well. Why? The market may be trading in a channel and you wish to sell at resistance or buy at support, whichever comes first by placing two limit orders at either end of the channel. To place OCO orders, via the right mouse click context menu select the menu name "OCO Order" or use the shortcut key Ctrl + Z. The "oc" (OCO indicator) will light up green. All orders placed while this indicator is lit will be part of the same OCO group. Once an order of this group is either filled or canceled, all other orders that belong to this group will be canceled.

    Note: If an order which was part of an OCO group has already been filled or canceled, you will need to submit the pending order with a new OCO ID otherwise the pending order will be rejected. To reset an OCO ID, simply disable the OCO function, and re-enable. This will generate a new OCO ID and allow you to place new orders.
    Please let me know if I can assist any further.

    Please let me know if I can help you any further.

    Comment


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

      Comment


        #4
        How to Auto-Reset OCO ID using ninjascript?

        Comment


          #5
          Hello stevenrosenquist,

          If you are making your own OCO strings in NinjaScript they need to be unique, you can use the GetAtmStrategyUniqueId method for that purpose. You otherwise can't reset an OCO, once its been used you cannot re use that same OCO string again.

          JesseNinjaTrader Customer Service

          Comment


            #6
            Hey Jesse,
            I am not, I am running a strategy made on the platform and for some reason it send that error every time I run it. is there anything on the ninja trader platform that will allow RealtimeErrorHandling.IgnoreAllErrors without stopping the strategy or having to go in and edit code? If there is not is there literature on how to write this code?
            Last edited by stevenrosenquist; 07-07-2023, 07:51 PM.

            Comment


              #7
              Hello stevenrosenquist,

              If you are running into a oco already used error that could be happening based on what you made. If you use the unmanaged approach you can create your own OCO id's which is where you would need GetAtmStrategyUniqueId. If you did not make a unmanaged strategy meaning you used the builder or coded it as a normal managed strategy there are situations where you could see that error reported if you have conflicting logic.

              The ignore all errors will keep a strategy running for any order based errors meaning the broker sent back an error or rejection. For any runtime errors like reusing an oco that would need to be handled by modifying the code so that does not happen.
              JesseNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by zstheorist, Today, 07:52 PM
              0 responses
              3 views
              0 likes
              Last Post zstheorist  
              Started by pmachiraju, 11-01-2023, 04:46 AM
              8 responses
              149 views
              0 likes
              Last Post rehmans
              by rehmans
               
              Started by mattbsea, Today, 05:44 PM
              0 responses
              5 views
              0 likes
              Last Post mattbsea  
              Started by RideMe, 04-07-2024, 04:54 PM
              6 responses
              33 views
              0 likes
              Last Post RideMe
              by RideMe
               
              Started by tkaboris, Today, 05:13 PM
              0 responses
              5 views
              0 likes
              Last Post tkaboris  
              Working...
              X