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 NullPointStrategies, Today, 05:17 AM
    0 responses
    53 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X