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 slendivan, Today, 03:43 AM
        0 responses
        2 views
        0 likes
        Last Post slendivan  
        Started by muratb35, Today, 03:36 AM
        0 responses
        1 view
        0 likes
        Last Post muratb35  
        Started by fernlicht, Today, 02:16 AM
        1 response
        7 views
        0 likes
        Last Post NT-Roland  
        Started by fernlicht, 04-12-2021, 06:01 PM
        1 response
        28 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by memonolog, Today, 02:10 AM
        1 response
        3 views
        0 likes
        Last Post cincai
        by cincai
         
        Working...
        X