Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitOnSessionCloseSeconds doesn't work with conditional input

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

    ExitOnSessionCloseSeconds doesn't work with conditional input

    Hello,

    I wanted to also optimize ExitOnSessionCloseSeconds, with not just default 30 seconds, but XOSC * 60 (variable multiplied by seconds in a minute).

    Yet it doesn't work, no matter what number I input at XOSC, it always exits at the same time.

    Can this be manipulated? And if default method is not able to achieve it, maybe there's a way to get session end time value, so I could check, like Time[0] > EndTime - XOSC *60, then it would exit.

    #2
    Hello UltraNIX,

    Thank you for your note.

    Are you seeing this in a backtest, or on real time data? ExitOnSessionCloseSeconds is a real time only property and wouldn't have any effect when running the strategy on historical data, such as in a Strategy Analyzer backtest or on historical data on a chart.

    That being said, it is possible to modify this based on a variable. I'm attaching an example script that will override any user input setting for this in State.Configure by using a variable * 60.

    This will only work in real time, so you can either test on a live chart using the Sim101 account or using Market Replay data with the Playback connection.

    Please let us know if we may be of further assistance to you.

    Attached Files

    Comment


      #3
      Yes, I was trying to run it on Historical data. I will try to test it on Market Replay data. Thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      43 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      21 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      30 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Working...
      X