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 ageeholdings, Today, 07:43 AM
    0 responses
    6 views
    0 likes
    Last Post ageeholdings  
    Started by pibrew, Today, 06:37 AM
    0 responses
    4 views
    0 likes
    Last Post pibrew
    by pibrew
     
    Started by rbeckmann05, Yesterday, 06:48 PM
    1 response
    14 views
    0 likes
    Last Post bltdavid  
    Started by llanqui, Today, 03:53 AM
    0 responses
    6 views
    0 likes
    Last Post llanqui
    by llanqui
     
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    12 views
    0 likes
    Last Post burtoninlondon  
    Working...
    X