Chart Backtesting VS Portfolio Backtesting
From MultiCharts
Strategies in the Portfolio Trader and on charts are calculated using the same fundamental rules.
However, some calculation settings are supported only in the Portfolio Trader, while others are supported only on charts.
Therefore, backtesting results on charts and in the Portfolio Trader should match if:
- Strategy, signal and instrument settings are identical.
- Only settings supported by both the chart and the Portfolio Trader are used.
- Data series and calculation starting points are the same.
Calculation Specifics
There are functionalities that are available only in the Portfolio Trader and not on charts, and vice versa.
Refer to the table below for details to ensure that only settings supported by both the charts and the Portfolio Trader are used in your setup.
Portfolio Trader | Charts |
---|---|
Money Management Settings To prevent them from limiting the submission or volume of orders generated by the strategy, set them to
|
Intra-Bar Order Generation in backtesting (On every tick option) |
Trade Size calculated as a Percent of Equity | Bar Magnifier (affects only backtesting) |
With Close button option for Generate Orders Within a Bar (affects only real-time trading) | Precise Backtesting (affects only backtesting) |
Close Position button (affects only real-time trading). | Ignore Tick Cache in Real-Time on Additional Data Series option (affects only real-time trading). |
Portfolio Money Management keywords | Send Intrabar Orders Immediately option (affects only real-time trading). |
Instrument Settings
Using several instruments in the Data1 column in the Portfolio Trader may shift the start of the calculation compared to a chart, where there is always a single primary series. For convenience, compare the Portfolio with one primary series (one instrument in the Data1 column) to a single chart.
- Only one symbol from one data source must be used and they must be identical on the chart and in Portfolio Trader.
- The following parameters should be set identically:
- Chart type
- Resolution
- Quote Field
- Sessions
- Build volume on if the strategy uses volumes in its calculations.
- Data Range* should be specified as From/To and not Days/Bars Back.
- Time Zone*
Signal Settings
- Signal inputs on the chart should match those in Portfolio precisely.
- Intra-Bar Order Generation has to be disabled on charts, because this mode is not available in Portfolio.
Strategy Settings
The following strategy settings should also match:
- On the Properties tab:
- Commission Rule
- Slippage
- Init Capital (for Portfoio this parameter is specified in the common Portfolio Settings)
- Maximum number of bars study will reference
- Position limits
- Trade size
- On the Backtesting tab:
- Backtesting assumptions
- Realtime-history matching
- Bar Magnifier and Extended backtesting are unavailble for Portfolio, so on the chart it is required to disable these options.
Even with all of these recommendations implemented there’s a possibility that the backtesting results in both applications will not match. This is related to the code’s specific and one should review the strategy’s code to find the reason for the discrepancy. An example of how to do that can be found here.