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 JGriff5646, Today, 10:02 PM
                0 responses
                6 views
                0 likes
                Last Post JGriff5646  
                Started by AdamDJ8, Today, 09:18 PM
                0 responses
                3 views
                0 likes
                Last Post AdamDJ8
                by AdamDJ8
                 
                Started by knowmad, Today, 03:52 AM
                2 responses
                29 views
                0 likes
                Last Post knowmad
                by knowmad
                 
                Started by ETFVoyageur, Today, 07:05 PM
                0 responses
                11 views
                0 likes
                Last Post ETFVoyageur  
                Started by Orion815, 05-02-2024, 08:39 AM
                2 responses
                18 views
                0 likes
                Last Post Orion815  
                Working...
                X