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 jxs_xrj, 01-12-2020, 09:49 AM
    6 responses
    3,290 views
    1 like
    Last Post jgualdronc  
    Started by Touch-Ups, Today, 10:36 AM
    0 responses
    9 views
    0 likes
    Last Post Touch-Ups  
    Started by geddyisodin, 04-25-2024, 05:20 AM
    11 responses
    62 views
    0 likes
    Last Post halgo_boulder  
    Started by Option Whisperer, Today, 09:55 AM
    0 responses
    8 views
    0 likes
    Last Post Option Whisperer  
    Started by halgo_boulder, 04-20-2024, 08:44 AM
    2 responses
    25 views
    0 likes
    Last Post halgo_boulder  
    Working...
    X