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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    67 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    36 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    59 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X