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 CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        476 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        317 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        254 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        340 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        305 views
        0 likes
        Last Post CarlTrading  
        Working...
        X