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 GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,279 views
    0 likes
    Last Post Leafcutter  
    Started by WHICKED, Today, 12:45 PM
    2 responses
    19 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by Tim-c, Today, 02:10 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Taddypole, Today, 02:47 PM
    0 responses
    5 views
    0 likes
    Last Post Taddypole  
    Started by chbruno, 04-24-2024, 04:10 PM
    4 responses
    51 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Working...
    X