Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SubmitOrder and Exit on Close

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

    SubmitOrder and Exit on Close

    Hello,
    I'm having an issue with the SubmitOrder() and Exit on Close
    While backtesting my strategy I noticed the first few days worked fine, but by the end of the strategy an exit was acting as an entry and throwing everything else off. I tracked it down to 8/9 when there was a Exit on Close called by NT that exited one of my positions. I trade with two contracts 1 for short gains and 1 for long gains. In this example the 2 longs were filled at 14:53:34. At 15:32:46 the Quick exited. The Runner entry shows to have exited at 18:06:59, but in fact there was an Exit on Close at 16:00:00 that exited the Runner entry. So the Exit at 18:06:59 turned into an entry and everything was messed up from that point forward.
    Code:
    8/09   14:53:34 -- ID: NT-00588, BullQuickIII Enter, Action: Buy, AvgFillPrice: 691.8
    8/09   14:53:34 -- ID: NT-00589, BullRunnerIII Enter, Action: Buy, AvgFillPrice: 691.8
    8/09   15:32:46 -- ID: NT-00588, BullQuickIII Exit (RMI), Action: Buy, AvgFillPrice: 691.9
    8/09   15:32:46 -- ID: NT-00590, BullQuickIII Exit (RMI) Order, Action: SellShort, AvgFillPrice: 697.7
    8/09   18:06:59 -- ID: NT-00589, BullRunnerIII Exit (VMAZones), Action: Buy, AvgFillPrice: 691.9
    8/09   18:06:59 -- ID: NT-00592, BullRunnerII Exit (VMAZones) Order, Action: SellShort, AvgFillPrice: 693.5
    8/09   18:49:19 -- ID: NT-00593, BullQuickIII Enter, Action: Buy, AvgFillPrice: 693
    8/09   18:49:19 -- ID: NT-00594, BullRunnerIII Enter, Action: Buy, AvgFillPrice: 693
    Now I'll probably never hold a position after trading hours and I know I can specify the time to exit and perhaps that's the only option, but I'm wondering if someone knows another way to have the SubmitOrder() identify this Exit on Close and not enter the next order?
    Thanks

    #2
    Hi CaptainAmericaXX,

    There's unfortunately no way to use the object returned from an ExitOnClose order. If you need this level of control, would have to set ExitOnClose = false, and then custom program your own end of session handling.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    670 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    379 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    111 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    575 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    582 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X