+1 888 340 6572
MultiCharts Project Management
Go to the previous open issue
Go to the previous issue (open or closed)
Please log in to bookmark issues
Open Bug report MC-649

Incorrect value for "Longest Flat Period"

Go to the next issue (open or closed)
Go to the next open issue

I'm using the Portfolio Backtester. In the Portfolio Performance Report, there is a value provided for "Longest Flat Period" under "Time Analysis."

I noticed that regardless of the strategy or inputs that I'm using, I'm always given a "Longest Flat Period" of "9 months, 18 days." I.e., even if I choose an entirely different strategy or different sets of inputs, I'll always receive the same reported "Longest Flat Period" value.

I believe that this value is an artifact of my "maximum bars back" setting (more precisely, "Maximum Number of Bars Study will Reference"). In my portfolio strategies, I am testing a strategy that uses daily bars from January 1, 2000 to the present, with a "maximum bars back" setting of 200 days. Given these settings, the portfolio is loading data from January 1, 2000 to the present, but it does not actually begin trading until after the 200-day period has expired (i.e., approximately October 2000).

It appears that the Portfolio Performance Report is including this 200 day period in its "Longest Flat Period" calculation. I.e., this non-trading period from January 1, 2000 to October 2000 is considered "flat," and is being reported as the "longest flat period."

I confirmed this by changing the "maximum bars back" setting to 400 days. With these settings, the strategy does not begin trading until July 2001. The reports then indicated a "Longest Flat Period" of "1 year, 7 months, 4 days" -- i.e., 400 days.

This seems to be a bug, or at least unexpected behavior. The non-trading period of 200 days is just an artifact of the setup process -- e.g., to calibrate moving averages before trading actually begins. A strategy can't make any trades during this period, so this shouldn't be considered as a "flat period" within the strategy report. Instead, the "longest flat period" should be calculated based on any real flat periods after the trading actually begins.

I believe that the same also happens when testing individual strategies within MultiCharts (rather than Portfolio Backtester), although I haven't confirmed that.

Steps to reproduce this issue
  1. Open a portfolio strategy in Portfolio Backtester that makes frequent trades.
  2. Give the strategy a maximum-bars-back setting of 200.
  3. Backtest the strategy.
  4. Note the "Maximum Flat Period" value in the performance report.
Comments (0)
Issue basics
  • Type of issue
    Bug report
  • Category
    Not determined
  • Targeted for
    MultiCharts 7.2 (RELEASED)
  • Status
  • Priority
    Not determined
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (3)
People involved
  • Posted by
    user-offline.png  Xyzzy (Xyzzy)
  • Owned by
    Not owned by anyone
  • Assigned to
    Not assigned to anyone
  • Subscribers
    0 subscriber(s)
    Click here to show the list of subscribers
Times and dates
  • Posted at
  • Last updated
Issue details
  • Reproducability
    Not determined
  • Severity
Attachments (0)
There is nothing attached to this issue
Commits (0)
There are no code checkins for this issue
Duplicate issues (0)
This issue does not have any duplicates