Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

ExitOnSessionCloseSeconds has no effect in backtest

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

    ExitOnSessionCloseSeconds has no effect in backtest

    Dear NT support team,

    I'm currently failing to get positions to exit at a certain time before the session close in backtests.
    https://ninjatrader.com/support/help...oseseconds.htm
    Click image for larger version  Name:	Exit on Session Close.jpg Views:	10 Size:	224.2 KB ID:	1124391
    Is there something that I have overlooked? My timezone is EST and session definitions are NT default.
    Thanks.
    Last edited by MojoJojo; 10-25-2020, 04:25 AM.

    #2
    Hi MojoJojo,
    To my understanding, ExitOnSessionCloseSeconds is a real time property.
    For backtests, you will have to specify an exit time, compare current time to exit time, then exit.
    NT-Roland

    Comment


      #3
      Hi Roland,

      thanks for your advice, I'll implement a manual exit.
      If this is intended behavior for simulations, the documentation should be updated to reflect the limitations of the parameter.

      Comment


        #4
        Hello MojoJojo,

        Are you referring to the warning in the help guide:

        "On historical data, IsExitOnSessionCloseStrategy will cause positions to be exited at the close of the last bar of the session. If you are using a non time-based Bar Type, such as Renko, and have "Break at EOD" set to False on the Data Series, this means that IsExitOnSessionCloseStrategy could trigger after the session close, since the last bar of the session can extend beyond the session close time in this scenario."
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello Chelsea,

          thanks the reference, it's good to inform the user that NT might not be able to exit a position at the end of the session because of the choice of bars.

          Referencing my screenshot, what I am trying to convey is:
          * data series NQ 5 min
          * 17:00 session close time
          * ExitOnSessionCloseSeconds 7200 -> 2hrs

          The expected behavior would be for any position to be exited at around 15:00 and no new entries should occur until 18:00.

          The result is that the value of ExitOnSessionCloseSeconds doesn't matter, open positions are exited at 17:00.
          My question therefore is, am I doing something wrong? Does ExitOnSessionClosesSeconds not apply to my use case or are there steps that could be taken to bring what actually happens in line with the expected behavior?

          Because it's not too complicated and I don't want to wait, my strategy handles the situation now manually, everything is fine, at least for me.

          Comment


            #6
            Hello MojoJojo,

            When backtesting, it would be expected that the position is exited at the end of the trading session as defined by the trading hours. The ExitOnSessionCloseSeconds is ignored as stated in the help guide.

            At what time does the trading hours template end the session for that day?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Hello Chelsea,

              thanks for the reply. Fair enough, I stand corrected, the help guide contains the information.
              The IsExitOnSessionCloseStrategy note in the documentation could be merged with the warning paragraph.

              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