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 CarlTrading, Yesterday, 09:41 PM
    1 response
    20 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, Today, 02:41 AM
    0 responses
    6 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, Yesterday, 11:44 PM
    0 responses
    17 views
    0 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    33 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    32 views
    0 likes
    Last Post CarlTrading  
    Working...
    X