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 CarlTrading, Yesterday, 09:41 PM
    1 response
    27 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, Today, 02:41 AM
    0 responses
    10 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, Yesterday, 11:44 PM
    0 responses
    21 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    37 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    34 views
    0 likes
    Last Post CarlTrading  
    Working...
    X