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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    88 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    48 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    31 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    34 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    69 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X