Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NinjaTrader ignores orders

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

    NinjaTrader ignores orders

    It has been written a lot about similar issues but I haven’t found a post describing my problem.
    I have written a prototype code but can’t get around a sticky point . . .

    When a long entry order fills, the OnExecution method submits P/L target orders:

    ExitLongStop( BarsInProgress, true, execution.Quantity, execution.Price - 5 * TickSize, @"ExitLongStop_2", @"" );
    ExitLongLimit( BarsInProgress, true, execution.Quantity, execution.Price + 5 * TickSize, @"ExitLongLimit_2", @"" );

    Then OnBarUpdate does the following:

    ExitLongStop( Close[ 0 ] - 4 * TickSize, @"ExitLongStop_1", @"" );

    The target orders have to be submitted explicitly vs. using SetStopLoss and SetProfitTarget as otherwise the "ExitLongStop_1" order would be ignored. Wondering why?

    Now, the sticky point. In OnBarUpdate, instead of exiting via ExitLongStop I want to reverse the position with EnterShortStop with the same stop price. I would expect that this would result in the same stop order being sent to the brokerage with the only difference being double quantity. But the call to the EnterShortStop method is ignored. The best solution I have in mind is to call EnterShort when the "ExitLongStop_1" order fills but that’s a bad solution.

    I would appreciate any ideas.

    Thanks
    Yuriy

    #2
    Yuriy, thanks for the post - you might want to check this article from our help guide out for info about the 'Internal Order Handling Rules' - http://www.ninjatrader-support.com/H...verview36.html (Please review the bottom section of the link for those).

    Then when testing your order placement, enabled TraceOrders in the Initialize and open the Output window for updates on your invidual order status - http://www.ninjatrader-support2.com/...ead.php?t=3627

    Your solution to circumvent the above rules, is valid...for NinjaTrader 7 we offer an 'unmanaged order submission' feature then -



    New Unmanaged Order Submission
    In 6.5 some users were burdened with our "Internal Order Handling" rules. We have introduced unmanaged order submission which bypasses the convenience of our order handling layer. This lower level of programming allows you to do what you want relative to order submission/management without any limitations other than any imposed by your broker. There are only three methods, SubmitOrder(), ChangeOrder() and CancelOrder(). You then get the flexibility of managing your orders how you see fit and optionally handling rejections.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    647 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X