×

Sign up and get MultiCharts free

Use its powerful simulation mode with data included out of the box. Just fill out the form and start honing your trading skills with a few clicks.

Changes - MultiCharts
Open main menu

Changes

Precise Backtesting

1,063 bytes added, 31 January
no edit summary
==Understanding Precise Backtesting==
Depending on the strategy, Precise Strategy Back Testing Backtesting can give the user a more realistic emulation during back testingbacktesting. To back test backtest high frequency strategies like statistical arbitrage, the user may need to take into account the historical bid/ask data in addition to the historical trade data.
With Precise Back TestingBacktesting, the user can load the historical bid data series and the historical ask data series into MultiCharts. MultiCharts will use the ask data series to fill buy market orders , buy stop and buy stop limit orders. Similarly, MultiCharts will use the bid data series to fill sell market orders , sell stop and sell stop limit orders.
Consider a situation where a market order to buy 1 contract and a market order to sell 1 contract are submitted at the same time at the close of a bar. If the user only uses the trade data series, then there is only one price for the close. The back test backtest will show that these two orders were filled at the same price, and the profit/loss is zero. In reality, there's a bid/ask spread. If the price quote doesn’t move suddenly, then these two orders will undoubtedly generate an instantaneous loss due to the bid/ask spread. That's why it’s more precise to back test backtest with a bid data series and an ask data series.
Consider another situation where the trade price doesn't occur on either the bid or the ask. Due to liquidity or other reasons, the historical data series may show that the trade price was either in between or outside the bid/ask. In this situation, the user may want to be conservative and assume fills at the bid/ask instead of at the trade price.
<syntaxhighlight>If Time=1000 Then Buy 1 Contract This Bar on Close;
<br>If Time=1100 Then Sell 1 Contract This Bar on Close;</syntaxhighlight>
If this strategy was back tested backtested on simply a data series of historical trade prices, then the back test backtest will assume that the trades were filled at the close prices of the bars. However, it's unclear whether the trades would have been filled at the close prices, because the close prices could have been on either the bid or the ask.
If the close price was an ask price and the strategy was buying, then the fill price was realistic.
However, if the close price was an ask price and the strategy was selling, then the fill price was unrealistic.
With Precise Back TestingBacktesting, users can load two separate data series onto the chart. The first data series is for historical bid prices. The second data series is for historical ask prices. MultiCharts will use these two data series to determine realistic fill prices. The bar's close will have a bid and an ask price associated with it. MultiCharts will use the ask price to fill a market buy order and the bid price to fill a market sell order.
==Using Precise Backtesting==
To use Precise Strategy Back TestingBacktesting:
# Make sure the symbol contains historical bid and ask data.
## In the '''Quote Field''' drop-down list, select '''Ask'''.
## Select '''OK'''.
# Add the same symbol into with the same resolution to this chart window. The chart window now has two chartsdata series.
# Designate this chart (the second chart) as the '''Bid''' data series:
## Open the '''Format Instrument''' window.<br><span>{{FormatSymbol}}</span>
## Select the '''Settings''' tab.
## In the '''Resolution''' field specify the same resolution as for the Ask data series.
## In the '''Quote Field''' drop-down list, select '''Bid'''.
## Select '''OK'''.
# Apply the strategy Add a signal to the '''Ask''' data series, which is the first chart: [[Using_Studies#Inserting_Studies|see "Inserting Studies"]]. It does not matter if the strategy is applied to # Enable the '''AskExtended Backtesting''' data series or the '''Bid''' data series. It only matters that the strategy is applied to the first chart.mode:
## Open the '''Strategy Properties''' window.<br><br>To open the '''Strategy Properties''' window:
### Open the '''Format Objects''' window.<br><span>{{FormatObjectIS}}</span>
## Click '''OK'''.
<br>
== Advanced Backtesting Settings ==
* '''Realtime-history matching''' <br>This option allows MultiCharts to synchronize the calculation of studies based on several data series. When using several data series calculation on historical data may differ from real-time calculation. Realtime-history matching option makes historical calculation results closer to real-time. More info is [[Realtime-History Matching|here]]
* '''Ignore Tick Cache in Real Time on Additional Data Series''' <br>If this option is enabled, during the calculation of the study on additional data series in real time, only the current state of the bar of the additional data series is taken into account. Tick cache of that bar is ignored.
* '''Send intrabar orders immediately'''<br><div style="background-color: #E5F6FF;">This option will become available in the next MultiCharts 15 Open Beta version.</div>If this option is enabled, orders generated on events specified in the IOG settings will be sent immediately after calculation.<br>If disabled, orders will be sent on the next tick after calculation.
[[Category:Backtesting]]