Difference between revisions of "Why Identical Charts Are Showing Different Strategy Trading Results"

From MultiCharts
Jump to navigation Jump to search
Line 5: Line 5:
  
 
== Different Starting Points of Strategy Calculation ==  
 
== Different Starting Points of Strategy Calculation ==  
When a chart is created and a strategy is applied to the chart, it is backtested immediately displaying entries and exits. It is important to understand that the starting point of calculation in this case is not the first bar due to [[Strategy Properties#Setting Maximum Bars Back|MaxBarsBack value]] (aka Maximum number of bars a study will reference) ''the first bar when an order can be generated ('to be placed on next bar') is bar # X'', where '''X = MaxBarsBack value + 1'''.
+
When a chart is created and a strategy is applied to the chart, it is backtested immediately displaying entries and exits. It is important to understand that the starting point of calculation in this case is not the first bar due to [[Strategy Properties#Setting Maximum Bars Back|MaxBarsBack value]] (aka Maximum number of bars a study will reference) ''the first bar when an order can be generated (''''to be placed on next bar'''') is bar # X'', where '''X = MaxBarsBack value + 1'''.
 
<div style="background-color: #E3FBE5;">'''Example''': Let's say a signal contains only 1 line: '''buy next bar market''' and the MaxBarsBack is set to '''50'''. It means script will be be calculated only at close bar # '''51''' to place the '''buy market''' at open of bar # '''52'''. Depending on the [[Auto Trading#Mode Selection|selected mode of auto trading]], the starting point for a strategy to calculate may differ.
 
<div style="background-color: #E3FBE5;">'''Example''': Let's say a signal contains only 1 line: '''buy next bar market''' and the MaxBarsBack is set to '''50'''. It means script will be be calculated only at close bar # '''51''' to place the '''buy market''' at open of bar # '''52'''. Depending on the [[Auto Trading#Mode Selection|selected mode of auto trading]], the starting point for a strategy to calculate may differ.
  
 
=== Synchronous Mode ===
 
=== Synchronous Mode ===
 
In SA mode at the moment you click the button to toggle automaton on, the starting point of strategy calculation is shifted from the beginning of the chart to the previous to current bar and the strategy starts calculation from scratch. Meanwhile, when you create identical chart to see the strategy calculating in real-time (forward-testing) the starting point is still at bar # = bar # 1 + MaxBarsBack value, not the current or previous to current bar. Different starting points lead to different results.
 
In SA mode at the moment you click the button to toggle automaton on, the starting point of strategy calculation is shifted from the beginning of the chart to the previous to current bar and the strategy starts calculation from scratch. Meanwhile, when you create identical chart to see the strategy calculating in real-time (forward-testing) the starting point is still at bar # = bar # 1 + MaxBarsBack value, not the current or previous to current bar. Different starting points lead to different results.

Revision as of 08:34, 11 June 2013

One should not expect 100% identical results between backtested, calculating in real-time (forwardtesting) and auto trading charts. The results may be close but it is almost impossible to make them absolutely the same.

Difference in Order Execution

Even if 2 charts (chart A is auto trading and chart B is calculating in real-time) are set up ideally to generate same orders on the same bars, the execution of the orders depends on different factors for each of the charts. To learn more, please read about general differences in results of Backtesting vs Live Trading.

Different Starting Points of Strategy Calculation

When a chart is created and a strategy is applied to the chart, it is backtested immediately displaying entries and exits. It is important to understand that the starting point of calculation in this case is not the first bar due to MaxBarsBack value (aka Maximum number of bars a study will reference) the first bar when an order can be generated ('to be placed on next bar') is bar # X, where X = MaxBarsBack value + 1.

Example: Let's say a signal contains only 1 line: buy next bar market and the MaxBarsBack is set to 50. It means script will be be calculated only at close bar # 51 to place the buy market at open of bar # 52. Depending on the selected mode of auto trading, the starting point for a strategy to calculate may differ.

Synchronous Mode

In SA mode at the moment you click the button to toggle automaton on, the starting point of strategy calculation is shifted from the beginning of the chart to the previous to current bar and the strategy starts calculation from scratch. Meanwhile, when you create identical chart to see the strategy calculating in real-time (forward-testing) the starting point is still at bar # = bar # 1 + MaxBarsBack value, not the current or previous to current bar. Different starting points lead to different results.