• 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

NT8 Strategy Error "The OCO ID 'xxxxx' cannot be reused. Please use new OCO ID."

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

    NT8 Strategy Error "The OCO ID 'xxxxx' cannot be reused. Please use new OCO ID."

    Hello Support,

    The strategy submits Market Orders using OCO for Profit Target and Stoploss. The strategy uses Managed Approach with SetProfitTarget and SetStoploss methods.

    I've never had to care about the OCO ID of any Strategy generated order ?

    What can I code into the strategy that will ensure a Unique OCO ID ?

    Thank you

    #2
    Hello rayko,

    Thanks for your post.

    What version of NT8 are you using? (Look under Help>About)

    Is this a strategy builder strategy or a Ninjascript based strategy?

    Does this occur on every order or occasionally?

    Please post a simplified version of your strategy that demonstrates the issue so we may test.

    Alternatively, please write into PlatformSupport[at]NinjaTradaer[dot]Com, mark the e-mail Atten: Paul and include a link to this thread.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      The Version is 8.0.17.1.

      The strategy started out as builder strategy that I later released so I could customize it.

      The error occurs occasionally.

      I'll try to create something for you, however it would really help if you could tell me what NT8 is using to derive the OCO ID.

      Is it OrderName and is there a limit on the string length ?

      For example for OCO ID to be unique the ordername must be less than 30 characters and cannot include $#%& (special charactors) or something.... (I'm just spit balling as to why...)

      Please let me know.

      Comment


        #4
        Hello rayco,

        Thanks for your reply.

        For example of OCO ids, you can check the "Orders" tab of the control center under the OCO column. (If no information you can place a couple of orders in SIM101 with an ATM to see what is generated).

        I do not know what the string length limit is and will inquire further.

        I would not use special characters but I have no information advising that specifically and have not tested this.

        A colleague has advised you could use System.Guid.NewGuid() to generate a unique OCO-ID string


        Paul H.NinjaTrader Customer Service

        Comment


          #5
          This is an NT8 bug. You get the same error message when trading manually off the chart trader. OCOs worked fine in NT7.

          Comment


            #6
            Hello JohnFortune,

            Thanks for your first post.

            Regarding, "You get the same error message when trading manually off the chart trader." That would be true if you did not turn of the OCO after creating the order (Same as NT7). The NT8 help guide very explicitly advises, "Warning: After placing two orders within the same OCO group, it is important to disable OCO functionality before submitting any other orders. If you wish to place another set of OCO orders immediately after placing an initial set, first disable, then re-enable OCO before placing the second set of orders. This will generate a new OCO ID, rather than adding the new orders to an existing OCO group." Found in the section, " Understanding "One Cancels Other" (OCO) orders" on this page: https://ninjatrader.com/support/help...ng_orders4.htm

            If you wish to report a bug, please provide the specific steps and circumstances to recreate and we will be glad to investigate. We will also need to know what specific version of NinjaTrader8 you are using (found under Help>About).

            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by pstrusi, Today, 02:05 PM
            0 responses
            5 views
            0 likes
            Last Post pstrusi
            by pstrusi
             
            Started by Seastragg, Today, 01:21 PM
            1 response
            17 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by stafe, Today, 01:27 PM
            0 responses
            3 views
            0 likes
            Last Post stafe
            by stafe
             
            Started by Dagamos, Today, 11:48 AM
            2 responses
            13 views
            0 likes
            Last Post Dagamos
            by Dagamos
             
            Started by kantkant2, Yesterday, 03:20 PM
            4 responses
            25 views
            0 likes
            Last Post eDanny
            by eDanny
             
            Working...
            X