Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Oco and atm templates

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

    Oco and atm templates

    I have an issue creating an oco order with my ATM strategy. I got the oco working in unmanaged using submit order but it will not work using tHe ATM function it will only take the buy order or the sell order here is the code.

    if ( Position.MarketPosition == MarketPosition.Flat )
    {
    CancelAllOrders(true, true);
    atmStrategyId = GetAtmStrategyUniqueId();
    orderId = GetAtmStrategyUniqueId();



    //******************* THIS WORKS FOR OCO ********************************
    // SubmitOrder(0, OrderAction.Buy, OrderType.Stop, 2,0, longPrice, "Enter", "EnterLong");
    // SubmitOrder(0, OrderAction.SellShort, OrderType.Stop, 2,0, shortPrice, "Enter", "EnterShort");
    //************************************************** ***************************************

    //################### THIS DOES NOT WORK WITH OCO ONLY A BUY OR A SELL #####################

    AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.Stop,0 , longPrice, TimeInForce.Day,orderId, "test", atmStrategyId);
    AtmStrategyCreate(Cbi.OrderAction.SellShort, OrderType.Stop, 0, shortPrice, TimeInForce.Day,orderId, "test", atmStrategyId);

    //################################################## ###############
    }

    #2
    Hello,
    The ATMStrategyCreate() order method does not support OCO functionality.
    If we can be of any other assistance please let us know.
    Cody B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    77 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    45 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    27 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    62 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X