458
edits
Abeloglazova (talk | contribs) No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
==Understanding Precise Backtesting== | ==Understanding Precise Backtesting== | ||
Depending on the strategy, Precise Strategy | Depending on the strategy, Precise Strategy Backtesting can give the user a more realistic emulation during backtesting. To 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 | With Precise Backtesting, 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, buy stop and buy limit orders. Similarly, MultiCharts will use the bid data series to fill sell market, sell stop and sell 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 | 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 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 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. | 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. | ||
Line 14: | Line 14: | ||
If Time=1100 Then Sell 1 Contract This Bar on Close;</syntaxhighlight> | If Time=1100 Then Sell 1 Contract This Bar on Close;</syntaxhighlight> | ||
If this strategy was | If this strategy was backtested on simply a data series of historical trade prices, then the 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. | If the close price was an ask price and the strategy was buying, then the fill price was realistic. | ||
Line 22: | Line 22: | ||
However, if the close price was an ask price and the strategy was selling, then the fill price was unrealistic. | However, if the close price was an ask price and the strategy was selling, then the fill price was unrealistic. | ||
With Precise | With Precise Backtesting, 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 buy order and the bid price to fill a sell order. | ||
==Using Precise Backtesting== | ==Using Precise Backtesting== | ||
To use Precise Strategy | To use Precise Strategy Backtesting: | ||
# Make sure the symbol contains historical bid and ask data. | # Make sure the symbol contains historical bid and ask data. |