Chart Backtesting VS Portfolio Backtesting: Difference between revisions
From MultiCharts
No edit summary |
|||
Line 4: | Line 4: | ||
Therefore, backtesting results on charts and in the Portfolio Trader should match if: | Therefore, backtesting results on charts and in the Portfolio Trader should match if: | ||
*Strategy, signal and instrument settings are identical. | * Strategy, signal, and instrument settings are identical. | ||
*Only settings supported by both the chart and the Portfolio Trader are used. | * Only settings supported by both the chart and the Portfolio Trader are used. | ||
*Data series and calculation starting points are the same. | * Data series and calculation starting points are the same. | ||
==Instrument Settings== | ==Instrument Settings== |
Revision as of 12:06, 13 September 2024
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.
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. Percent of Equity option should not be used, since it is only supported in Portfolio Trader.
- 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.
Portfolio Trader Specific Settings
The following settings are unavailable on charts, therefore they need to be configured so that they don’t influence Portfolio backtesting. In the Money Management Settings section:
- Exposure = 100%
- Max % of Capital at Risk per Position = 100%
- Margin value = 0
- Max Potential Loss = 0
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.