Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OCO orders question

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

    OCO orders question

    try to sumbit two stop orders in both directions, then cancel the other if one get filled. it seems only allow me to place stop order in one dirction.
    code:
    protected override void OnBarUpdate()
    {
    if (BarsInProgress == 0)
    {
    entryOrderShort=EnterShortStop(0,true,1,close[0]-0.001,"Short");
    entryOrderLong=EnterLongStop(0,true,1,close[0]+0.001,"Long");
    }
    }
    only short orders placed, long orders completely ignored.
    Get below error message:
    Ignored PlaceOrder() method at 1/4/2008 1:00:00 AM: Action=Buy OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=1.9720 SignalName=Long' FromEntrySignal='' Reason='An Enter() method to submit an entry order has been ignore. Please search on the term 'Internal Order Handling Rules' in the Help Guide for detailed explanation.'

    #2
    Right. You cannot place simultaneous working entry orders in opposite directions.

    You should only place one. When price moves closer to the other one, cancel the first and replace it with the other direction.
    Josh P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    320 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    203 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    190 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    283 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    238 views
    0 likes
    Last Post CarlTrading  
    Working...
    X