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 ScottW, Today, 06:09 PM
      0 responses
      2 views
      0 likes
      Last Post ScottW
      by ScottW
       
      Started by Board game geek, 10-29-2023, 12:00 PM
      14 responses
      244 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by Waxavi, 04-19-2024, 02:10 AM
      4 responses
      56 views
      0 likes
      Last Post sonia0101  
      Started by cmtjoancolmenero, Today, 03:58 PM
      0 responses
      9 views
      0 likes
      Last Post cmtjoancolmenero  
      Started by Segwin, 05-07-2018, 02:15 PM
      11 responses
      1,779 views
      0 likes
      Last Post aligator  
      Working...
      X