+1 888 340 6572

Chart Backtesting VS Portfolio Backtesting: Difference between revisions

From MultiCharts
Tag: Reverted
Tag: Reverted
Line 75: Line 75:
#* [[Bar Magnifier]] and [[Precise_Backtesting|Extended backtesting]] are unavailble for Portfolio, so on the chart it is required to disable these options.
#* [[Bar Magnifier]] and [[Precise_Backtesting|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 [[Portfolio_Settings|'''Money Management Settings''']] section:
* Exposure = 100%
* Max % of Capital at Risk per Position  = 100%
* Margin value = 0
* Max Potential Loss = 0


<div class="important">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 [[Why_an_Order_Was_or_Was_Not_Executed|here]]. </div>
<div class="important">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 [[Why_an_Order_Was_or_Was_Not_Executed|here]]. </div>

Revision as of 13:27, 22 August 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.

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

  • Exposure = 100%
  • Max % of Capital at Risk per Position = 100%
  • Margin value = 0
  • Max Potential Loss = 0
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.
  1. Only one symbol from one data source must be used and they must be identical on the chart and in Portfolio Trader.
  2. The following parameters should be set identically:
Data Range and Time Zone for Portofio are specified in the common Data settings.

Signal Settings

  1. Signal inputs on the chart should match those in Portfolio precisely.
  2. 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:

  1. On the Properties tab:
  2. On the Backtesting tab:


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.