4.6.7 Price Movement Emulation within the Bar at Backtest and Optimization

From MultiCharts
Jump to navigation Jump to search
BarMagnifier

During historic calculation MultiCharts .NET emulates the movement within the bar, tick by tick, upon which the order can be filled. The emulation of the price movement within the bar, by default, is executed with the Intra-bar Price Movement Assumptions, upon all possible ticks.

Where the price moves after Open, towards High or Low of the bar, is specified by the proximity of Open to High or Low: if Open is closer to High, then the price movement will be emulated (upon Intra-bar Price Movement Assumptions) as Open –> High -> Low -> Close, or if Open is closer to Low as Open –> Low -> High -> Close. At all the sectors of it, all possible ticks are calculated with the minimum price step.But in real-time the emulation with [Intra-bar Price Movement Assumptions] does not occur, every tick, received from the data source, is used.

To emulate the price movement within the bar more precisely, and to be more precise on historic calculation to real-time calculation, there is Bar Magnifier mode in MultiCharts .NET. To enable Bar Magnifier mode, select Strategy Properties, at this dialog window, click on Backtesting tab and select Use Bar Magnifier at Backtesting Precision section.

In this window you can select by tick, by second, by minute or by day for greater precision.

In Bar Magnifier mode, the price movement within the bar will be emulated by ticks Open-High-Low-Close or Open-Low-High-Close (with Intra-bar Price Movement Assumptions, whether the Order is closer to High or Low) the smallest resolution within the detailed bar. In Bar Magnifier mode, it is considered that there are no ticks between the detailed resolution ticks.

There is also an Extended Backtesting mode in MultiCharts .NET, in which, the strategy still analyzes the signal data series (Data Series 1) to which the strategy is applied, but also executes upon the prices of an additional bid/ask data series (this can be any subsequent data series such as Data Series 2, 3, 4, 5, etc.) on the same chart that may be needed for the real trade emulation using symbols with big spread (for example, Forex). In Bar Magnifier Mode the main data series, Data Series 1 and the additional bid/ask data series; in this case Data Series 2 will be detailed. The calculation will be done using only Data Series 1 bars. The orders will be filled using the bid/ask ticks of Data Series 2 with the buy orders executed using the ask prices and the sell orders executed using the bid prices. The OpenPL will also be calculated using bid/ask prices of Data Series 2 and not the bar prices of Data Series 1.

Price Movement Assumptions

Backtesting Assumption

To emulate the lack of volume for the immediate Limit orders filling (if we want to emulate the trade on an illiquid instrument), the following rule can be specified: to fill Limit orders when the price crosses the Limit level by a specified number of points:

Using this mode, a Limit order will be filled upon Limit price and better, only if there will be the price on the bar that is better than the Limit by specified number of points.

Example 1:

Parameters of the symbol MinMove= 1, PriceScale=0.01, Backtesting Assumptions –classic, when the volume is always enough for the Limit application execution (Fill limit order when trade takes place at limit price or better) or Fill limit order when trade price goes beyond limit price by 0 point.

Let’s try to fill Sell Limit order with the price 12.44 on the bar with the prices: Open=12.23 High=12.45 Low=11.05 Close=11.96:

  1. Check if the order can be filled at Open. Since Open < Limit this order cannot be filled at the Open price.
  2. Check if the order can be filled at the ticks from Open (12.23) to High (12.45), as Open is closer to High, than to Low.

    12.23 – does not satisfy.
    12.24 – does not satisfy.

    12.43 – does not satisfy.
    12.44 – satisfies, order is filled at this price.


Example 2:

Parameters of the symbol MinMove=1, PriceScale=0,01, Backtesting Assumptions – lack of volume emulation for the immediate Limit order filling (Fill limit order when trade price goes beyond limit price by 2 points).
Let’s try to fill the Sell Limit order at the price 12.44 on the bar with the prices: Open=12.23 High=12.45 Low=11.05 Close=11.96:

  1. Check if the order can be filled at Open. Since Open < Limit this order cannot be filled at the Open price.
  2. Check if the order can be filled at the ticks from Open (12.23) to High (12.45), as Open is closer to High, than to Low.

  3. 12.23 – does not satisfy.
    12.24 – does not satisfy.

    12.43 – does not satisfy.
    12.44 – satisfies, but the order will be filled at this price only if the price on the given bar is better by 2 points.
    12.45 – satisfies, but it is only 1 point higher than the Limit price (we need 2 points higher). The order at 12.44 is not filling yet.

  4. Check if the order can be filled at the the movement from High to the Low.

  5. 12.45 – satisfies, but it is only 1 point higher than the Limit price (we need 2 points higher). The order at 12.44 is not filling yet.
    12.44 – satisfies, but the order will be filled at this price only if the price on the given bar is better by 2 points.
    12.43 – does not satisfy.

So, the order on this bar cannot be filled according to the chosen Limit orders execution emulation settings.