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 moved at the beginning, 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 ticks will be emulated upon Intra-bar Price Movement Assumptions: –> High -> Low -> Close, or: 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.
Then, check if the order can be filled at Open. As Open < Limit price, then this order cannot be filled at this price.
Let’s see, if the order can be filled at all the ticks from Open (12.23) to High (12.45), as Open os closer to High, than to Low.

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

12.43 – does not satisfy.
12.44 – does not satisfy this order. This order is filled at price 12,44.

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 it is possible to to fill the order at Open. As Open < Limit price, then the order cannot be filled at this price.
2. Check, if it is possible to fill the orders at all 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 – the price satisfies, but the order will be filled at this price only in case, if the price on the given bar is better by 2 points.
12.45 – the price satisfies the order, but it is only one point higher than the Limit price. The order at 12.44 is not filling yet.
3. Let’s check if the order can be filled at the sector of High->Low of the bar.
12.45 – the price satisfies the order, but it is only one point higher than the Limit price. The order at 12.44 is not filling yet.
12.44 – the price satisfies, but the order will be filled at this price only in case, 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.