Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitOnClose = true kills Strategy?

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

    ExitOnClose = true kills Strategy?

    I had ExitOnClose = true in the Initialize() method as I do not want to hold positions overnight. I noticed that when a position was closed by ExitOnClose, the strategy failed to continue running at the next FirstTickOfSession -- I would certainly expect the strategy to start executing orders again in the new session.

    Manually stopping & starting the bot is unreasonable. How can I programmatically kick it back into gear when the next session begins?

    #2
    Hi LostTrader,

    This is not how ExitOnClose works so something else is going on. Try backtesting SampleMaCrossOver with this setting. You'll see it close at end of sessions but continue to place trades.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      OK, I have just seen the same behaviour with the StopLoss - After the system closed the position, no more entries are taken.

      The code is running. What else can prevent orders without telling me anything in the output window?

      When my code closes a position, no problem. Next entry is taken.

      Comment


        #4
        OK found a variable that should have been removed -- that seems to have fixed it !

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        44 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        65 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X