Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit on Close - Problem

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

    Exit on Close - Problem

    Greetings,

    I have a problem with Exit on Close
    -I have it enabled for my strategy
    -I have defined the session template as start on Sunday night, end of Friday
    -It exits 30 seconds before 3pm every day

    My problem is that it should not be exiting on close unless the day is Friday at 3pm.

    Any ideas how to resolve this?

    #2
    Hello Moody1337,

    Welcome to the NinjaTrader forums. It looks the setup matches what you are going for. ExitOnClose works off session boundaries defined in the session template, so it should only be exiting at Friday.

    What version of NinjaTrader are you using?
    Do you see this with realtime / historical or both?
    Can it be seen historically with SampleMaCrossOver? - This is what I'm using to test and it correctly exits only on Friday end of session.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_RyanM View Post
      Hello Moody1337,

      Welcome to the NinjaTrader forums. It looks the setup matches what you are going for. ExitOnClose works off session boundaries defined in the session template, so it should only be exiting at Friday.

      What version of NinjaTrader are you using?
      Do you see this with realtime / historical or both?
      Can it be seen historically with SampleMaCrossOver? - This is what I'm using to test and it correctly exits only on Friday end of session.
      -I am using the most recent version of NT - downloaded yesterday from the website
      -I only see it with real-time, not historical
      -It cannot be seen in backtest/historical with sample MA

      Comment


        #4
        A little additional information:

        The chart even has the gridlines drawn correctly - for example it doesn't have the thick line showing the end of the session

        This comically-sized image is the trade:

        Last edited by Moody1337; 10-12-2011, 02:59 PM.

        Comment


          #5
          Thanks for the reply. There is a global flatten everything setting you may have enabled. Can you check this under Tools > options > Misc > Make sure Flatten all is unchecked.
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_RyanM View Post
            Thanks for the reply. There is a global flatten everything setting you may have enabled. Can you check this under Tools > options > Misc > Make sure Flatten all is unchecked.
            Flatten all is unchecked AND grayed out so I couldn't select it even if I wanted to.

            Comment


              #7
              I'm not sure why it would exit on close if not at the session boundary. When you ran the strategy, you made sure to select the custom session template?

              I will try to reproduce the same here but tricky as can only check it once per day. I do not know how it would pick that 3:00 PM time if not defined in the session template. See if it's possible to reproduce the same thing with market replay connection and we can then easily setup a test. If not, will give it a shot tomorrow after getting more details about your strategy and setup. Thank you.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                I am running it by right-clicking on the chart and adding the strategy to the chart, not by initializing it under the strategies tab.

                I have the chart set to my Sunday-Friday session template and unless I'm missing something, a strategy initialized this way will just mimic the session template of the chart, right?

                Comment


                  #9
                  Yes, the strategy will use the session template of the chart.
                  Ryan M.NinjaTrader Customer Service

                  Comment


                    #10
                    Hello,

                    Can you please send a note to support 'at' ninjatrader 'dot' com attn RyanM with your phone number and availability. We can try to reproduce this on your computer today and collect information about the strategy and steps.
                    Ryan M.NinjaTrader Customer Service

                    Comment


                      #11
                      Was there any resolution to this issue? I experienced something similar yesterday. I have as session setup to start at 8am Monday morning and close 6am Sunday yet I had a position 'exit on close' late last night.

                      Comment


                        #12
                        HitTheCity,

                        Unfortunately this is a current limitation with ExitOnClose.

                        NinjaScript strategies in real-time running on session templates that span multiple days would still have the ExitOnClose trigger every single day based on the end time of the session definition regardless that the day of week is not the end of the session definition yet.

                        If your session template spans multiple days, we recommend you set ExitOnClose = false and custom code any handling.
                        Ryan M.NinjaTrader Customer Service

                        Comment


                          #13
                          Thanks Ryan.

                          Probably a bit kind calling it a 'limitation', to me it seems like a bug plain and simple.

                          In any event, it isn't difficult to write the required custom code as you suggest. It is just disconcerting to find such a basic bug exists in a platform I intend to trade real money with.

                          Comment


                            #14
                            I understand -- sorry for any frustration regarding this. Fixing will require some framework changes, so we cannot change this in an incremental update. We are looking to address for our next major product release.
                            Ryan M.NinjaTrader Customer Service

                            Comment


                              #15
                              Good to know. Thank you again for the prompt response.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              666 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              377 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              110 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              575 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              580 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X