Announcement

Collapse
No announcement yet.

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, 03: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."
        https://ninjatrader.com/support/help...sestrategy.htm
        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 Jorge.andres.o, Today, 08:05 PM
              0 responses
              1 view
              0 likes
              Last Post Jorge.andres.o  
              Started by SuperDriveGuy, 10-23-2019, 07:13 AM
              23 responses
              1,346 views
              0 likes
              Last Post wadams
              by wadams
               
              Started by lmatiukas, Today, 07:09 PM
              1 response
              6 views
              0 likes
              Last Post lmatiukas  
              Started by ComfyCouch, Today, 06:04 PM
              0 responses
              14 views
              0 likes
              Last Post ComfyCouch  
              Started by Ousher, Today, 04:35 PM
              0 responses
              4 views
              0 likes
              Last Post Ousher
              by Ousher
               
              Working...
              X