Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitOnClose at end of backtest

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

    ExitOnClose at end of backtest

    Hello

    When running BackTest on a strat, i see that there is an automatic ExitOnClose when the backtest reaches the last bar of the backtest.

    Is it possible to disable this ? Would be nice to have it as an option.

    #2
    Hi zark.be, correct this is expected behavior. The only option would be the ExitOnClose setting, which applies to flatten the strategy at the session end times.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick response Bertrand.

      But even though my ExitOnClose is set to false. it still closes the positions.
      It's kinda disturbing my numbers.
      I'd rather see a "Open positions" and a "Unrealized PnL" rather than have it close all positions.
      Since those positions exits do not follow the logic of my strategy, i'd rather not have them.

      Please consider adding an option to the backtest dialog ! (or at least a variable in the initialize() method).

      Comment


        #4
        Are you referring to closing positions at the end of the backtest?

        With ExitOnClose set to False you should be staying in overnight though (depends of course also on your trading strategy logic).
        BertrandNinjaTrader Customer Service

        Comment


          #5
          i just knew i wouldn't express myself correctly.

          yes, i'm talking about the last last last last bar in a backtest.

          here's a screenshot.


          ExitOnClose is set to false, and doesn't close at the end of the day (as expected).

          BUT closes at the end of the backtest
          Attached Files

          Comment


            #6
            Ok, this is expected since it does this to calculate the backtesting statistics for your strategy. So you would like an option to exclude any still open trades from the backtest results?
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Indeed.
              I would like to have an option for that "flatten all positions at end of backtest" behavior.

              Since those positions exits do not follow the logic of my strategy, i'd rather not have them.


              Thank you bertrand

              Comment


                #8
                You are welcome Zark.be - I will forward your suggestion to development for future consideration, Thanks!
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by ttrader23, Today, 09:04 AM
                2 responses
                10 views
                0 likes
                Last Post ttrader23  
                Started by geotrades1, Today, 07:54 AM
                10 responses
                26 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by ninza33, Yesterday, 12:31 PM
                3 responses
                16 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by patrickmlee007, Today, 09:33 AM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_LuisH  
                Started by Vulgoth_t_Destroyer, 05-09-2022, 04:45 PM
                53 responses
                5,309 views
                0 likes
                Last Post BartMan
                by BartMan
                 
                Working...
                X