Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

at end of day

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

    at end of day

    Hi,
    I'm new to ninjatrader, I am looking for a way to make my automated strategy close all positions at the end of day ie. i am an intraday trader and do not want my positions to carry forwrard to the next day.
    thanks
    G

    #2
    Hello,

    You can use the ExitOnClose property in your automated strategy: http://www.ninjatrader.com/support/h...xitonclose.htm

    You could also use the Flatten Positions option which is configured under Tools--> Options--> Misc tab. Please note that this will flatten all positions regardless of them being using in a strategy or if they were discretionary trades

    Please see our Help Guide for more information on this topic:

    MatthewNinjaTrader Product Management

    Comment


      #3
      Thank you for your prompt reply. Will flatten everything work on backtests.

      rgds

      G

      Comment


        #4
        No, that would not work on a backtest. You would then need to set the exit on close property. Exit on close will run at the end of the session based off the session template you are using when running the backtest.
        MatthewNinjaTrader Product Management

        Comment


          #5
          thanks again, i can find the Exitonclose icon on the backtest window but how do i configure it. the link attached gives a definition and the code, but how can i set the exitonclose time to end of day please
          thanks again
          G

          Comment


            #6
            Please see our Help Guide on Understanding backtest properties. You should find an option that says 'ExitOnClose':



            As long as this is set to true, it will exit your position at the time the Session Template you are testing with is defined to end. You can double check the hours of your session tempalte by going to Tools--> Session Manager.
            MatthewNinjaTrader Product Management

            Comment


              #7
              Thanks for your help, but Exitonclose only works whre both entry and exits are on the same timescale. what i'm really looking for is to set my indicators to observe hourly bars for entry points and i want all open positions to close at end of day.

              Regards,

              G

              Comment


                #8
                There is no way from a NinjaScript strategy to tell it to close all positions. There is no cross communication between strategies. You would either need to program each strategy to close at a specific time, or you can use the flatten all feature from the Tools--> Options--> Misc tab.
                MatthewNinjaTrader Product Management

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                656 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                371 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                109 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                574 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                579 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X