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

  • MojoJojo
    replied
    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.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    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?

    Leave a comment:


  • MojoJojo
    replied
    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.

    Leave a comment:


  • NinjaTrader_ChelseaB
    replied
    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."

    Leave a comment:


  • MojoJojo
    replied
    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.

    Leave a comment:


  • NT-Roland
    replied
    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

    Leave a comment:


  • 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.

Latest Posts

Collapse

Topics Statistics Last Post
Started by FrancisMorro, Today, 03:24 AM
0 responses
1 view
0 likes
Last Post FrancisMorro  
Started by Segwin, 05-07-2018, 02:15 PM
10 responses
1,769 views
0 likes
Last Post Leafcutter  
Started by Rapine Heihei, 04-23-2024, 07:51 PM
2 responses
30 views
0 likes
Last Post Max238
by Max238
 
Started by Shansen, 08-30-2019, 10:18 PM
24 responses
943 views
0 likes
Last Post spwizard  
Started by Max238, Today, 01:28 AM
0 responses
10 views
0 likes
Last Post Max238
by Max238
 
Working...
X