Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit On Close

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

    Exit On Close

    Is Exit on Close expected to work the same in replay as real time, meaning should the position close 30 seconds (or whatever specified) prior to close of session when running replay, or is this real time only?

    Thanks,
    Guy
    TraderGuy
    NinjaTrader Ecosystem Vendor - EMS

    #2
    Guy,

    You should find it to work in replay as well.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks,

      It works fine in my back test but I'm not having any luck on replay. I have it coded in the strategy and set up on the strategy parameters. I'm using calculate bar on close = True, not update by tick. Am I missing something here?

      Guy
      Last edited by TraderGuy; 12-31-2008, 12:24 PM.
      TraderGuy
      NinjaTrader Ecosystem Vendor - EMS

      Comment


        #4
        Check your chart's session begin/end times.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          The session times are set 9:30 - 4:00 so that should be fine. Related question, with "calculate bar on close" = true, will the OnMarketData method operate intra-bar? Looks like it does from the doc, if so I can utilize that to exit at a predetermined time.

          Thanks,
          Guy
          TraderGuy
          NinjaTrader Ecosystem Vendor - EMS

          Comment


            #6
            Hi Guy, do you get any errors in the Log section? How did you set the ExitOnCloseSeconds? You are correct OnMarketData is called for every change in Level1 data, not sure how you want to use it to set a time exit though.

            You can also try coding your time filter rules out, like in this reference sample - http://www.ninjatrader-support2.com/...ead.php?t=3226

            Comment


              #7
              Hi,

              No error that I have seen.

              The code in the strategy is

              Code:
              		ExitOnClose        = true; 
                  		ExitOnCloseSeconds = 30;
              Strategy properties are set the same way, with session time 9:30 AM to 4:00PM.

              I'll create a simple strategy or use one of the provided strategies and test the EOD close again when I get a chance.

              Thanks,
              Guy
              TraderGuy
              NinjaTrader Ecosystem Vendor - EMS

              Comment


                #8
                Guy,

                Please try with the SampleMACrossOver on a replay of a more volatile instrument. If you are trying to replay a low volatility one you may not have data for minutes before the close and that may or may not be a source of the issue.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Had a chance to try replay after the close today with the SampleMACrossOver as requested. This was done with SPY so liquidity was not an issue. The open position was not closed prior to end of session, it did work as expected with the historical trades.

                  However, I was running a strategy real-time today and it did work as expected. So for me anyway, it works when back testing at the close of the bar (as expected), and works in real-time as expected, just not in replay.

                  It's not a big deal to me now that I have seen it work in real time. Just thought I would follow up.

                  Regards,
                  Guy
                  TraderGuy
                  NinjaTrader Ecosystem Vendor - EMS

                  Comment


                    #10
                    Hello,

                    Thank you for your follow up. Someone will reply on Monday if we have any further information to provide. Sorry for the delay.
                    DenNinjaTrader Customer Service

                    Comment


                      #11
                      Guy,

                      If you could send us your replay file that would be great. Thank you.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        Sent via email.

                        Regards,
                        Guy
                        TraderGuy
                        NinjaTrader Ecosystem Vendor - EMS

                        Comment


                          #13
                          Thanks Guy, we got the file and will respond after trying to reproduce this, thanks for your patience!

                          Comment


                            #14
                            Hi Guy, I tested your SPY replay data with the SampleMACrossover strategy (settings 2 and 5 to get some trades done) on 1min and 5min Market Replay chart and the exit on close worked as expected on my end. For chart session times I used 7:30 AM to 2:00 PM.

                            Comment


                              #15
                              Very strange, tried it here on two machines, no joy with replay, live and back test are fine. It's a mystery. Thanks for checking it out.

                              Guy
                              TraderGuy
                              NinjaTrader Ecosystem Vendor - EMS

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              558 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              324 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              101 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              545 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              547 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X