Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

exit at a certain hour

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

    exit at a certain hour

    Hi

    i read the guide 'exitonclose'...

    but if i want the same thing than exitonclose (close all position, close all script etc...) at a time... like 5 pm, what the script ?

    thx

    #2
    Set your ExitOnClose to true and then change your chart session to end at 5pm.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      and if i don't want each time i run my backtest or strategy change the end chart session...
      i write that code and it doesn't work... my market close at 22:00... in want my backtest close at 18:00 so 14400 seconds before the end...

      protectedoverridevoid Initialize()
      {
      // close at 18:00
      ExitOnClose = true;
      ExitOnCloseSeconds =
      14400;
      }

      I have each time when i run my backtest change the hour of my market session... and why it doesn't not take my script automatically ?

      Comment


        #4
        Not following you exactly. ExitOnCloseSeconds is not a backtest property. That is only used in real-time when you actually have seconds granularity. In a backtest it runs off of session end times.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        152 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        89 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        131 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        127 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        107 views
        0 likes
        Last Post CarlTrading  
        Working...
        X