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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    60 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    147 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    97 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    284 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X