Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

exit on close

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

    exit on close

    What would exactly happen when we set exit on close as true for a strategy?

    Suppose the close time is 4:00PM CT.
    The renko bar which crosses the 4:00PM is from 3:30PM to 6:00PM.

    When will the true 'exit on close' will trigger a trade close, 1) around 3:59PM but before 4:00PM when the current renko bar doesn't close, 2) at 4:00PM when the current renko bar doesn't close, or 3) at 6:00PM when the current renko bar closes.

    Thank you.

    #2
    Hello microsat,

    Thank you for writing in.

    ExitOnClose works intrabar.

    When your strategy will exit with ExitOnClose set to true depends on what you have set for the ExitOnCloseSeconds property: http://ninjatrader.com/support/helpG...oseseconds.htm

    By default, this is set to 30 seconds prior to session close.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      got it. Thank you.

      Can we programmatically set true or false for this option (exit on close, 30 seconds or 100 seconds or others prior to close), just like we do for DrawOnPricePane? Thank you.

      Comment


        #4
        Hello microsat,

        Yes, you can programmatically set ExitOnClose to true or false.

        You'll want to do this within the Initialize() method.



        Please, let us know if we may be of further assistance.
        Zachary G.NinjaTrader Customer Service

        Comment


          #5
          I used a renko bartype with exit on close as true. I noticed all exit on close happened at the close of the bar prior to the bar crossing the exit time. Is this a bug for backtesting?

          For example

          the 100th bar closes at 3:00 pm.
          the 101th bar closes at 4:21 pm.

          When I set the exit on close as true and ExitOnCloseSeconds = 30 and my close time is 4:00pm.
          The order will be always be filled at the close price of the 100th bar, no matter what the price at 3:30PM is.

          Looking forward to your reply.

          Originally posted by NinjaTrader_ZacharyG View Post
          Hello microsat,

          Yes, you can programmatically set ExitOnClose to true or false.

          You'll want to do this within the Initialize() method.



          Please, let us know if we may be of further assistance.

          Comment


            #6
            Hello microsat,

            ExitOnCloseSeconds is only a real-time property: https://ninjatrader.com/support/help...oseseconds.htm

            It will not function during a backtest.

            With exit on close set to true in a backtest, the strategy will exit at the last bar of session.

            It wouldn't be expected for the chart to show the exit on a bar previous to the session close bar.

            Can you please provide a screenshot of what you are witnessing on your chart?

            To send a screenshot with Windows 7 or newer I would recommend using Window's Snipping Tool.

            Click here for instructions

            Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

            Click here for detailed instruction
            Zachary G.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            88 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            48 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            30 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            34 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            68 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X