Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OCO ID is Global?

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

    OCO ID is Global?

    I'm using OCO ID within an unmanaged strategy and when I run the strategy on two instruments, the IDs are connected. Is there a way to isolate it to the instrument the strategy is running on?

    #2
    Hello,

    You could do something along the lines of the following
    Code:
    //at some point before submitting the order make sure Instrument is not null
    if (Instrument != null)
    {
    //while you wouldn't need an OCO for the order used here you can see how you would use the Instrument.FullName to create an OCO ID specific to the instrument.
    entryOrder = SubmitOrder(0, OrderAction.Buy, OrderType.Market, 1, 0, 0, [B]"1234"+Instrument.FullName[/B], "Enter Long");
    }
    http://www.ninjatrader.com/support/h...t_fullname.htm

    Additionally you can use http://www.ninjatrader.com/support/h...gyuniqueid.htm to get a unique ID

    Please let me know if I can be of further assistance.
    LanceNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    25 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    115 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    69 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    225 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    411 views
    0 likes
    Last Post CaptainJack  
    Working...
    X