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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        574 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        332 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X