726
edits
No edit summary |
|||
(7 intermediate revisions by 3 users not shown) | |||
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. | ||
Line 35: | Line 35: | ||
## In the '''Quote Field''' drop-down list, select '''Ask'''. | ## In the '''Quote Field''' drop-down list, select '''Ask'''. | ||
## Select '''OK'''. | ## Select '''OK'''. | ||
# Add the same symbol | # Add the same symbol with the same resolution to this chart window. The chart window now has two data series. | ||
# Designate this chart (the second chart) as the '''Bid''' data series: | # Designate this chart (the second chart) as the '''Bid''' data series: | ||
## Open the '''Format Instrument''' window.<br><span>{{FormatSymbol}}</span> | ## Open the '''Format Instrument''' window.<br><span>{{FormatSymbol}}</span> | ||
## Select the '''Settings''' tab. | ## 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'''. | ## In the '''Quote Field''' drop-down list, select '''Bid'''. | ||
## Select '''OK'''. | ## Select '''OK'''. | ||
# | # Add a signal to the chart: [[Using_Studies#Inserting_Studies|see "Inserting Studies"]]. | ||
# Enable the '''Extended Backtesting''' mode: | |||
## Open the '''Strategy Properties''' window.<br><br>To open the '''Strategy Properties''' window: | ## Open the '''Strategy Properties''' window.<br><br>To open the '''Strategy Properties''' window: | ||
### Open the '''Format Objects''' window.<br><span>{{FormatObjectIS}}</span> | ### Open the '''Format Objects''' window.<br><span>{{FormatObjectIS}}</span> | ||
Line 52: | Line 54: | ||
## Click '''OK'''. | ## Click '''OK'''. | ||
<br> | <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]] | [[Category:Backtesting]] |