Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

unexpected behaviour in Trading Hours

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

    #16
    Hello fredfred,

    Thank you for your response.

    Calculate.OnBarClose would result in waiting for the bar to close to verify the ExitOnSessionClose. In the case of ExitOnSessionCloseSeconds set to 30 and the BarsType being 1 Minute we would not see the Exit attempted until after the session closed. So you would likely need to increase ExitOnSessionCloseSeconds to 90.

    Trading Hours template affects the data viewed for the strategy. Since you set the ExitOnSessionCloseSeconds to 30 any tick after that time can still open position. ExitOnSessionClose is to exit a position, not prevent new entries.

    Please let me know if I may be of further assistance.

    Comment


      #17
      Hello fredfred,

      I wanted to further provide an example that prevents trades after the exit on close.
      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 wzgy0920, 04-20-2024, 06:09 PM
      2 responses
      26 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, 02-22-2024, 01:11 AM
      5 responses
      32 views
      0 likes
      Last Post wzgy0920  
      Started by wzgy0920, Yesterday, 09:53 PM
      2 responses
      49 views
      0 likes
      Last Post wzgy0920  
      Started by Kensonprib, 04-28-2021, 10:11 AM
      5 responses
      192 views
      0 likes
      Last Post Hasadafa  
      Started by GussJ, 03-04-2020, 03:11 PM
      11 responses
      3,234 views
      0 likes
      Last Post xiinteractive  
      Working...
      X