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 burtoninlondon, Today, 12:38 AM
    0 responses
    5 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    12 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    13 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,982 views
    3 likes
    Last Post jhudas88  
    Working...
    X