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

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 inanazsocial, Today, 01:15 AM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by rocketman7, Today, 02:12 AM
        0 responses
        10 views
        0 likes
        Last Post rocketman7  
        Started by dustydbayer, Today, 01:59 AM
        0 responses
        1 view
        0 likes
        Last Post dustydbayer  
        Started by trilliantrader, 04-18-2024, 08:16 AM
        5 responses
        23 views
        0 likes
        Last Post trilliantrader  
        Started by Davidtowleii, Today, 12:15 AM
        0 responses
        3 views
        0 likes
        Last Post Davidtowleii  
        Working...
        X