Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

"Exit on close seconds" not working

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

    "Exit on close seconds" not working

    Any idea what might cause a strategy to exit on the close instead of at the specified seconds before close?

    It was working fine and then after working on the strategy code some more, it stopped working. I have no idea what I changed that might affect it.
    Attached Files

    #2
    motownlucas, is the timeframe you're trading greater than 30 minutes (1800 seconds)?
    AustinNinjaTrader Customer Service

    Comment


      #3
      Hi Austin,

      Yes, I'm trading US Equities RTH. 9:30-3:30

      Comment


        #4
        Thanks for that info, what about the bar length? What kind of bars are you trading on - time, volume, tick, etc?
        AustinNinjaTrader Customer Service

        Comment


          #5
          1, 3, or 5 minute bars

          Comment


            #6
            motownlucas, please test the strategy again with TraceOrders = true in the Initalize() section of your strategy and see if there are any messages in the output for why the ExitOnClose isn't being called at the correct time.
            AustinNinjaTrader Customer Service

            Comment


              #7
              I'm back

              Sorry Austin, I got impatient and hard-coded an exit-before-close in my strat so this is more academic now. Back to troublshooting...

              I don't see anything in the output below, do you? In fact I don't see the exit-on-close either, but it showed up on the chart.

              Time: 6/28/2011 2:10:00 PM

              Time: 6/28/2011 2:20:00 PM
              Changing unmanaged order at 6/28/2011 2:20:00 PM: Order='NT-00015/Sim101' Name='StopLoss_LX' State=Working Instrument='IWM' Action=Sell Limit price=0 Stop price=81.26 Quantity=122 Strategy='_FrogStrat_1_archive' Type=Stop Tif=Gtc Oco='longExitBrkt' Filled=0 Fill price=0 Token='97d288f624aa430783c2c3ea7f0351c1' Gtd='12/1/2099 12:00:00 AM'

              Time: 6/28/2011 2:30:00 PM

              Time: 6/28/2011 2:40:00 PM
              Changing unmanaged order at 6/28/2011 2:40:00 PM: Order='NT-00015/Sim101' Name='StopLoss_LX' State=Working Instrument='IWM' Action=Sell Limit price=0 Stop price=81.31 Quantity=122 Strategy='_FrogStrat_1_archive' Type=Stop Tif=Gtc Oco='longExitBrkt' Filled=0 Fill price=0 Token='97d288f624aa430783c2c3ea7f0351c1' Gtd='12/1/2099 12:00:00 AM'

              Time: 6/28/2011 2:50:00 PM
              Changing unmanaged order at 6/28/2011 2:50:00 PM: Order='NT-00015/Sim101' Name='StopLoss_LX' State=Working Instrument='IWM' Action=Sell Limit price=0 Stop price=81.35 Quantity=122 Strategy='_FrogStrat_1_archive' Type=Stop Tif=Gtc Oco='longExitBrkt' Filled=0 Fill price=0 Token='97d288f624aa430783c2c3ea7f0351c1' Gtd='12/1/2099 12:00:00 AM'

              Time: 6/28/2011 3:00:00 PM

              Time: 6/28/2011 3:10:00 PM

              Time: 6/28/2011 3:20:00 PM

              Time: 6/28/2011 3:30:00 PM

              Time: 6/28/2011 3:40:00 PM

              Time: 6/28/2011 3:50:00 PM

              Time: 6/28/2011 4:00:00 PM
              Changing unmanaged order at 6/28/2011 4:00:00 PM: Order='NT-00015/Sim101' Name='StopLoss_LX' State=Working Instrument='IWM' Action=Sell Limit price=0 Stop price=81.36 Quantity=122 Strategy='_FrogStrat_1_archive' Type=Stop Tif=Gtc Oco='longExitBrkt' Filled=0 Fill price=0 Token='97d288f624aa430783c2c3ea7f0351c1' Gtd='12/1/2099 12:00:00 AM'

              Comment


                #8
                motownlucas, ExitOnClose would not be shown in the trace orders - so this trace you show would be expected in this case. ExitOnCloseSeconds is only applicable to realtime trading and market replay, not backtesting, here the session times set would be used.

                Comment

                Latest Posts

                Collapse

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