Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy not closing unmanaged stopmarket orders on session close

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

    Strategy not closing unmanaged stopmarket orders on session close

    I have this unmanaged strategy. On session close, it is closing open positions. But not closing the limit orders and stopmarket orders that I am using as targets and stoploss. I tried using Bars.IsLastBarOfSession to cancel the order manually. But it doesnt seem to work. The strategy is going into the IF block with Bars.IsLastBarOfSession everyday until the previous day but not on the last day.

    Screenshot: https://paste.pics/152f703e19436d339df102f0a672a89e

    #2
    Hello fawzanalim,

    Is the strategy running with Exit on session close enabled?
    If so, I would expect all working orders to be cancelled.

    Are you certain the orders are not being re-submitted after the exit on close event?

    Below is a link to a forum post with a video that demonstrates the exit on close will cancel all working orders and has an example script of how to prevent new orders after this event.
    NinjaTrader Community, A common inquiry is that the Exit on close didn't work in a NinjaScript Strategy because there is a position after the exit on close should have occurred. When viewing the log we often find that the Exit on close does indeed exit the position shortly before the end of the session (based on the Exit on

    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X