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 pmachiraju, 11-01-2023, 04:46 AM
                8 responses
                148 views
                0 likes
                Last Post rehmans
                by rehmans
                 
                Started by mattbsea, Today, 05:44 PM
                0 responses
                5 views
                0 likes
                Last Post mattbsea  
                Started by RideMe, 04-07-2024, 04:54 PM
                6 responses
                33 views
                0 likes
                Last Post RideMe
                by RideMe
                 
                Started by tkaboris, Today, 05:13 PM
                0 responses
                5 views
                0 likes
                Last Post tkaboris  
                Started by GussJ, 03-04-2020, 03:11 PM
                16 responses
                3,282 views
                0 likes
                Last Post Leafcutter  
                Working...
                X