Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OCO String

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

    OCO String

    Hi,

    In the unmanaged approach, when OCO linking two orders, what is the correct usage of the OCO string? Do I generated it by myself, and give it as an argument to all orders I wish to link? Are there any restrictions? Should it be unique across the platform?

    Thanks,
    Boaz

    #2
    Hello Boaz,
    Thanks for your post.
    In oco order you have to assign the oco string. If one order is filled/cancelled it will cancel all order with the same oco id.
    So say the current market price of any contract is $100 and you place one buy limit order at $99 and another buy stop order at $101 with an oco id as “buy”, like

    Code:
    this.SubmitOrder(0, OrderAction.Buy, OrderType.Stop, 1, 0, 101, "buy", "BuyStop");
    
    this.SubmitOrder(0, OrderAction.Buy, OrderType.Limit, 1, 99, "buy", "BuyLmt");
    Thus if the buy limit order is filled, the buy stop order will get cancelled.


    Also OCO ids are not tied to a strategy instance.

    Please do 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
    639 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    366 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    107 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    569 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    572 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X