+1 888 340 6572

Chart Backtesting VS Portfolio Backtesting: Difference between revisions

From MultiCharts
No edit summary
(4 intermediate revisions by the same user not shown)
Line 3: Line 3:
==Instrument settings==
==Instrument settings==


<div class="important">Portfolio workspace should contain only 1 symbol in the [[Data_Numbers|'''Data 1''']] column!</div>
<div class="important">Portfolio workspace should contain only 1 symbol in the [[Data_Numbers|'''Data 1''']] column</div>


# [[Changing_Symbols|Only one symbol]] from one [[:Category:Built-in_Data_Sources|data source]] must be used and they must be identical in both the MultiCharts Chart and the Portfolio Trader;
# [[Changing_Symbols|Only one symbol]] from one [[:Category:Built-in_Data_Sources|data source]] must be used and they must be identical in both the MultiCharts chart and the Portfolio Trader;
# The following parameters should be set identically:
# The following parameters should be set identically:
#* Chart type - regular or [[:category:Non-Standard_Chart_Types|non-standard]];
#* [[:Category:Chart_Types|Chart type]]
#* [[Chart_Resolution|Resolution]];
#* [[Chart_Resolution|Resolution]]
#* [[Quote_Field|Quote Field]];
#* [[Quote_Field|Quote Field]]
#* [[Sessions]];
#* [[Sessions]]
#* [[Chart_Resolution#Build_Volume_On_Selector|Build volume on]] (if the strategy uses volumes in its calculations);
#* [[Chart_Resolution#Build_Volume_On_Selector|Build volume on]] if the strategy uses volumes in its calculations.
#* [[Data_Range|Data Range]]* - should be specified as From…To and not Days/Bars Back;
#* [[Data_Range|Data Range]]* should be specified as '''From/To''' and not '''Days/Bars Back'''.
#* [[Time_Zone|Time Zone]]*.
#* [[Time_Zone|Time Zone]]*
<nowiki>*</nowiki>[[Operating_Portfolios#Data_Range|Data Range]] and [[Operating_Portfolios#Time_Zone|Time Zone]] for Portofio are specified in the [[Operating_Portfolios#Data_Series_Properties|common Data settings]].
<div class="footnote">[[Operating_Portfolios#Data_Range|Data Range]] and [[Operating_Portfolios#Time_Zone|Time Zone]] for Portofio are specified in the [[Operating_Portfolios#Data_Series_Properties|common Data settings]].</div>


==Signal settings==
==Signal settings==


# [[Signal_Settings#Setting_Input_Values|Signals’ inputs]] on the chart should match those in Portfolio precisely;
# [[Signal_Settings#Setting_Input_Values|Signal inputs]] on the chart should match those in Portfolio precisely;
# [[Signal_Settings#Intra-Bar_Order_Generation|Intra-Bar Order Generation]] has to be disabled on charts, because this mode is not available in Portfolio.
# [[Signal_Settings#Intra-Bar_Order_Generation|Intra-Bar Order Generation]] has to be disabled on charts, because this mode is not available in Portfolio.


Line 26: Line 26:


# on the '''Properties''' tab:
# on the '''Properties''' tab:
#* [[Strategy_Properties#Setting_Costs.2FCapitalization|Commission Rule]];
#* [[Strategy_Properties#Setting_Costs.2FCapitalization|Commission Rule]]
#* [[Strategy_Properties#Setting_Costs.2FCapitalization|Slippage]];
#* [[Strategy_Properties#Setting_Costs.2FCapitalization|Slippage]]
#* [[Strategy_Properties#Setting_Costs.2FCapitalization|Init Capital]] (for Portfoio this parameter is specified in the common [[Portfolio_Settings|Portfolio Settings]]);
#* [[Strategy_Properties#Setting_Costs.2FCapitalization|Init Capital]] (for Portfoio this parameter is specified in the common [[Portfolio_Settings|Portfolio Settings]])
#* [[Strategy_Properties#Setting_Maximum_Bars_Back|Maximum number of bars study will reference]];
#* [[Strategy_Properties#Setting_Maximum_Bars_Back|Maximum number of bars study will reference]]
#* [[Strategy_Properties#Setting_Position_Limits|Position limits]];
#* [[Strategy_Properties#Setting_Position_Limits|Position limits]]
#* [[Strategy_Properties#Setting_Trade_Size|Trade size]];
#* [[Strategy_Properties#Setting_Trade_Size|Trade size]]
# on the '''Backtesting''' tab:
# on the '''Backtesting''' tab:
#* [[Limit_Order_Execution_Assumptions|Backtesting assumptions]];
#* [[Limit_Order_Execution_Assumptions|Backtesting assumptions]]
#* [[Realtime-History_Matching|Realtime-history matching]];
#* [[Realtime-History_Matching|Realtime-history matching]]
#* [[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.


Line 44: Line 44:
* Margin value = 0
* Margin value = 0
* Max Potential Loss = 0
* Max Potential Loss = 0
<br>


<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 15:23, 17 June 2024

MultiCharts and Portfolio Trader serve different purposes, and backtesting on charts and in Portfolio is not supposed to match. Still there are some recommendations that can help bringing the backtesting on charts and in Portfolio as close to each other as possible.

Instrument settings

Portfolio workspace should contain only 1 symbol in the Data 1 column
  1. Only one symbol from one data source must be used and they must be identical in both the MultiCharts chart and the 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:

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.