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 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
    Kate W.NinjaTrader Customer Service

    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 DJ888, 04-16-2024, 06:09 PM
      4 responses
      12 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by terofs, Today, 04:18 PM
      0 responses
      6 views
      0 likes
      Last Post terofs
      by terofs
       
      Started by nandhumca, Today, 03:41 PM
      0 responses
      5 views
      0 likes
      Last Post nandhumca  
      Started by The_Sec, Today, 03:37 PM
      0 responses
      3 views
      0 likes
      Last Post The_Sec
      by The_Sec
       
      Started by GwFutures1988, Today, 02:48 PM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Working...
      X