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 RideMe, 04-07-2024, 04:54 PM
        5 responses
        28 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by f.saeidi, Today, 08:13 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by DavidHP, Today, 07:56 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by kujista, Today, 06:23 AM
        3 responses
        10 views
        0 likes
        Last Post kujista
        by kujista
         
        Started by Mindset, Yesterday, 02:04 AM
        2 responses
        18 views
        0 likes
        Last Post NinjaTrader_RyanS  
        Working...
        X