Tick Backtesting

After emerging from the rigours of optimization and robustness testing, it is time to verify our strategy’s performance using tick data.

Tick data records every price movement over the historical period, helping maximize our backtest precision. The table below shows an example of AUDUSD tick data obtained from Tickstory, with numerous prices per second.

We will proceed to conduct tick backtests on the GBPJPY trend strategies previously developed in MT4 and StrategyQuant. If these strategies manage to remain profitable, they may eventually form part of a live portfolio.

But before we do that, let’s talk about whether your strategy requires a tick backtest, and some sources of quality tick data.

Should You Backtest With Tick Data?

Throughout the development of our GBJPY trend strategies, each bar in our price history consisted of only 4 points – the open, high, low and close prices.

This allowed for much faster backtesting, at the expense of some precision. Due to the large number of trading ideas that can be tested, and the subsequent optimizations that accompany each idea, I consider this a necessary compromise.

Now that all our optimizations are complete, we can ramp up the test precision to obtain more accurate performance metrics. These metrics will help us determine whether the strategy can meet our trading goals, and allow us to establish expectations for live trading.

For these reasons, I always include a tick backtest in my development workflow. Unfortunately, tick backtesting is slow, and high-quality tick data is seldom free. To help you decide, I recommend doing a tick backtest if your strategy contains any of the following characteristics:

Has a Small Average Trade

Your average trade, or expectancy, is the profit you expect per trade.

If your strategy attempts to ride the occasional major trend, a less precise backtest will probably suffice. However, if your strategy is a sensitive scalper that captures only a few pips per trade, an increase in backtest precision can severely impact your metrics.

On a related note, you need to pay attention to your backtest’s transaction costs if your average trade is low. These costs – in the form of spread, slippage and commissions – need to be simulated as accurately as possible.

If you use the default backtester in MT4, only the spread can be specified. You may wish to exaggerate the spread to simulate commissions and slippage as well. More advanced backtesting platforms such as StrategyQuant and Tick Data Suite give you the option to apply variable spreads, slippage and commissions.

Depends on Intrabar Price Action

If your strategy makes decisions based on the price movement within each bar, a tick backtest may be warranted.

Your strategy likely contains some elements that are always active in the market. For example, if you use stop/limit entry orders, or trailing stops to exit the market, a tick backtest will more accurately reflect the time and/or price levels at which these actions occurred.

This is a good opportunity to discuss the perils of backtesting with limit orders. Limit orders allow you to enter the market at a target price or better. If you have a buy limit order in place, it will only be executed if price falls by a specified amount or more.

Many backtest engines assume that your limit order will be completely filled once the target price is hit. In reality though, for reasons of liquidity, the market often has to penetrate your target price before a complete fill will occur. If the market reaches your target price and rebounds off, you may only get a partial fill, or no fill at all.

If your backtest incorrectly assumes that your limit order has been completely filled, you backtest will show ‘phantom’ winning trades whereby the market bounced off your limit price and eventually reached your profit target. On the other hand, losing trades that were entered on limit orders will accurately register in your backtest. The overall result is an optimistic backtest containing a number of winning trades that would have been missed, or only partially executed, in reality.

This is primarily a limitation of your backtest engine, although poor quality data will obviously exacerbate the loss of accuracy. If you use limit orders, it may be best to forward test your strategy on a demo or small live account.

Places Multiple Orders Within a Bar

If your strategy contains more than one order within a single bar, the absence of intrabar price modeling can result in particularly inaccurate backtests. 

For example, you may trade a breakout strategy where you place both a buy and sell stop on the same bar, or a scalping strategy where the stop loss and profit target are only a few pips apart. If the intrabar price action is not modelled in your backtest, you will not know which order gets triggered first since the bar range encompasses both orders.

Where Do I Get Quality Tick Data?

MT4’s Strategy tester actually allows you to run a simulated tick backtest using the ‘Every tick’ model. As detailed in this article, this is not a real tick backtest; MT4 uses the 1-minute OHLC prices as boundary values and randomly simulates price movement between them.

The ‘Modelling quality’ metric in the backtest report tells you how precise your tick backtest was. With this simulated approach, you will get a 90% quality at most. To run this test, you will need to download 1-minute OHLC data from your broker using MT4’s History Center. I have had success with Alpari’s data below. 

If you do decide to test using real tick data, you can achieve a 99.9% quality. The following are three common sources of quality tick data:

StrategyQuant

StrategyQuant’s integrated Data Manager allows you to conveniently download tick and 1-minute forex data from Dukascopy, which can then be used with StrategyQuant’s backtest engine. Most liquid forex pairs have data dating back to 2003. Custom time zones, spreads and commissions can be applied to each data set.

These data can also be exported to MT4 if you want to use its backtest engine. I regularly backtest in both platforms and have found the results to be similar. Data for the equity, futures or cryptocurrency markets are also available.

Tickstory

I have been using Tickstory since 2016. It offers quality tick data for forex, commodities, indices and even cryptocurrencies. There is a free version that allows you to export up to 1 year of tick data to MT4. Other supported platforms include Amibroker, Ninjatrader and Forex Tester.

Tick Data Suite

Tick Data Suite is an excellent product if you backtest in MT4. It allows you to set up an extremely detailed backtest configuration, including features such as variable spreads and slippage simulation.

Backtesting the GBPJPY Strategies With Tick Data

MT4 Development Section

In the MT4 development section, our trend strategy was manually developed by sequentially adding key elements. A CCI-entry was first chosen, after which a stop loss and time stop were added. Finally, a high-pass volatility filter helped avoid some false breakouts.

To drastically reduce computation time, this strategy was developed using historical OHLC prices from 2015-2019. We will now backtest it with tick data obtained from Tickstory. The MT4 backtest report is shown below.

With a net profit/max drawdown ratio of 7.9 and an expectancy of over 60 pips, I would certainly consider trading this strategy live. An average of only 3 trades per month could mean inefficient capital usage though; it is probably best to trade this strategy as part of a portfolio.

How does this tick backtest compare with the OHLC backtest? The full backtest report using OHLC prices can be found in the ‘Filter Testing‘ article, but for clarity I will use QuantAnalyzer to superimpose the two equity curves below. A few pertinent performance metrics are also compared.

The two equity curves are extremely similar, with the tick backtest producing better metrics. I usually expect a slight performance deterioration (5-10%) when testing with tick data.

The strategy’s simplicity and its low reliance on intrabar price movement probably contributed to this positive result. The CCI-entry, volatility filter and time stop were all evaluated at the close of each bar; only the 180-pip stop loss was always active in the market.

Since forex is a decentralized market, each brokerage will offer a slightly different data feed. The OHLC prices used above were downloaded from Alpari, while the tick data originated from Dukascopy. A robust strategy should continue to perform well when tested on slightly different data.

StrategyQuant Development Section

The second GBPJPY strategy was developed using StrategyQuant’s genetic algorithm and subsequently put through stringent out-of-sample (OOS) testing. This involved backtesting on an additional 5 forex markets, and then performing multiple walk-forward optimizations (WFO) on it.

The strategy captures breakouts by placing stop entries at the previous week’s opening price. An ATR-based stop loss and bar-based time stop were used for trade management.

OHLC prices from 2003-2020 were used for development. Using StrategyQuant’s walk-forward matrix, we determined that 20 OOS runs and a 20% OOS data allocation would be optimal for our WFO.

We will now redo the optimization with these settings, but using tick data instead. The equity curve and performance metrics from the WFO are shown below.

A 13.3 return/max drawdown ratio is a good result, especially for a 17-year backtest. The 649-day stagnation is a little concerning though. Any further tweaks to try to reduce this stagnation could well result in overfitting; I find that stagnation is best reduced by trading a diverse portfolio of strategies. These results are compared to the OHLC results below.

The equity curves are largely similar over the 17 years. Compared to the MT4 strategy, there seems to be a slightly larger variation between the OHLC and tick backtests. Perhaps the longer backtest period and the repeated cycles of optimization and OOS testing were contributing factors.

Both backtest precisions yielded a similar return/max drawdown, but the tick backtest produced a slightly higher profit factor and expectancy. Once again, we are reaping the benefits of simplicity. When configuring StrategyQuant’s genetic algorithm to generate this strategy, the entry conditions and subsequent trade management were kept to a minimum.

It is often difficult to predict how your strategy’s performance will change when backtested with higher precision. I suspect that short-term strategies containing the characteristics in the ‘Should You Backtest With Tick Data?’ section above will show the most deterioration.

Using the results from the tick backtests, you need to determine whether the strategy meets your trading goals. Since I always trade a portfolio of strategies, my performance targets for each individual strategy tend to be less stringent. Portfolio trading is a great way to improve risk-adjusted returns and minimize stagnation. A diverse portfolio consisting of moderately good strategies can still achieve excellent overall results.

Wrapping Up

Tick data can maximize your backtest precision and is highly recommended if your strategy has a small average trade, or often executes trading actions in the middle of a bar.

Tick backtests were performed on the pair of GBPJPY trend following strategies previously developed using MT4 and StrategyQuant. For both strategies, the tick backtest produced better results than the OHLC backtest. The performance metrics of the tick backtest will be used to determine whether the strategy meets your trading goals, and serve as benchmarks if the strategy is eventually traded live.

Nonetheless, there is no data feed or backtest engine that is perfect. Sometimes you need to forward test your strategy in real-time to determine whether it contains a trading edge. This will be discussed in the article on forward testing.

Strategy Development Roadmap

Supercharge your strategy development with StrategyQuant

Access 14-day FREE trial here!

Get up to USD 300 discount!

Strategies need improvement?

Use QuantAnalyzer’s powerful analysis tools

Try the FREE version here!

Get 20% Discount here!

FXVM Forex VPS
Follow Us

Recent Posts

Laguerre RSI Trend Following Strategy

The Laguerre RSI attempts to improve the responsiveness of the regular RSI, whilst keeping whipsaw trades to a minimum. Let’s see how well it detects short-term pullbacks for a trend following strategy!

read more

What is Fixed Ratio Money Management?

Have you heard of fixed ratio money management? How does it compare to the popular fixed fractional approach? Here I’ll explain how fixed ratio works, and see how it stacks up against fixed fractional money management.

read more

Build a Diversified Portfolio With QuantAnalyzer

The ability to efficiently trade a diversified portfolio of strategies is one of the biggest advantages of algorithmic trading. Here we will use QuantAnalyzer’s Portfolio Master to build a portfolio consisting of high performing, uncorrelated strategies.

read more

What Is the QQE Indicator?

The QQE is a mysterious indicator that sometimes pops up in trading forums. Does it deserve a place alongside the more traditional momentum indicators like the RSI and CCI? Let’s add it to a trend following strategy to find out!

read more

Hey there, Wayne here! I’m on a mission to develop robust algorithmic trading strategies for the forex markets. Trading Tact is where I share my trading methods and insights.

Follow Us
Have a Question?

Comments

0 Comments

Submit a Comment

Your email address will not be published.

Supercharge your strategy development with StrategyQuant

Access 14-day FREE trial here!

Get up to USD 300 discount!

Strategies need improvement?

Use QuantAnalyzer’s powerful analysis tools

Try the FREE version here!

Get 20% Discount here!

FXVM Forex VPS

Recent Posts

Should You Use the Kelly Criterion for Forex Trading?

Should You Use the Kelly Criterion for Forex Trading?

The Kelly criterion is a famous mathematical formula that attempts to maximize your long-term capital growth. In this post, I’ll apply it to a EURUSD breakout strategy and explain some of its potential shortcomings when applied to forex trading.

read more

Hey there, Wayne here! I’m on a mission to develop robust algorithmic trading strategies for the forex markets. Trading Tact is where I share my trading methods and insights.

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Make your money work for you!

Make your money work for you!

 

Get trading ideas and strategy development tips delivered to your inbox!

Thanks for subscribing!

Pin It on Pinterest

Share This