Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit on close bug ?

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

    Exit on close bug ?

    Hi all

    I have applied a strategy on ES for one year continuous data. My strategy is intraday. That has produced more than 500 trades. Five trades have shown weird result. The entries on these trades have been triggered by Exit on close signal on the last bar on the day when at that time I had no position !

    Could someone help me find what that bug could be....


    Thanks


    Bernard

    #2
    Can you post up an image of a chart where you see this happening?
    RayNinjaTrader Customer Service

    Comment


      #3
      Ray

      Thanks for the response. I am out of the office almost all day. I will post an image as soon as I can.

      By the way I have solved the problem in setting the strategy's Exit on Close parameter to false. That is what is telling me that we could have a bug there...




      Bernard

      Comment


        #4
        Thanks. Look forward to the image.
        RayNinjaTrader Customer Service

        Comment


          #5
          I have included the file showing the strategy results.
          Notice that I got ExitonClose signal at the end of the day when I was flat. The Exit onClose signal gave me a new position which is kind o weird


          Bernard
          Attached Files

          Comment


            #6
            Thanks Bernard, will try reproducing this on my end here.

            Comment


              #7
              Bernard, so far I was unable to reproduce here - does it happen for you, too when you use for example the SampleMACrossOver and add a manual time exit taking you flat before the ExitOnClose would be expected to trigger? Thanks - will continue to check into and see if I can reproduce.

              Comment


                #8
                Bertrand


                I am using a lot of manual orders. I manually managed all my exit orders. I looked at my code and can't find why the Exit on Close stops would put me long or short iat the close f I have no position.




                Bernard

                Comment


                  #9
                  If I set the ExitOnClose option to false the system is showing correct numbers.



                  Bernard

                  Comment


                    #10
                    Bernard,

                    You cannot manually exit a NinjaScript strategy position. Just because you closed your trade from an account stand point, the strategy still thinks you are in a position and will place ExitOnClose orders.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Josh

                      Sorry I think that I didn't explain it the right way.

                      I am not exiting the trade manually. What I was trying to say is that I am managing all my trades with code (programmatically)....



                      Bernard

                      Comment


                        #12
                        Josh will reply on Monday.
                        RayNinjaTrader Customer Service

                        Comment


                          #13
                          Bernard,

                          Let us take a step back and go through the order of events. Please outline each as to what happens each step of the way and why you feel Exit on Close does not work properly. Thank you.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            Josh


                            I have strategies which all orders are managed by code. I am using the option from NT7 Exit on Close to make sure that I will get out at the end of the day, I am a day trader..

                            My exits order used the two methods OnExecution and OnOrderUpdate. Out of 1000 trades I got maybe 5 to 10 trades that are showing an ExitOnClose order as an new entry right at the close of the ES session.

                            My question is how NT7 can trigger an ExitOnClose order at the end of the day if my position is flat ? Somehow NT sees a position to trigger this Exit on Close order...


                            Bernard

                            Comment


                              #15
                              Bernard,

                              Please use one strategy and use TraceOrders = true to evaluate. Print your position from the strategy to see what the strategy position is. Be sure to note that just because your account position may be flat does not necessarily mean your strategy position is flat.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              605 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              351 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              105 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              560 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              561 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X