A Meta-Strategy in S&P 500 E-Mini Futures

In earlier posts I have described the idea of a meta-strategy as a strategies that trades strategies.  It is an algorithm, or set of rules, that is used to decide when to trade an underlying strategy.  In some cases a meta-strategy may influence the size in which the underlying strategy is traded, or may even amend the base code.  In other word, a meta-strategy actively “trades” an underlying strategy, or group of strategies, much as in the same way a regular strategy may actively trade stocks, going long or short from time to time.  One distinction is that a meta-strategy will rarely, if ever, actually “short” an underlying strategy – at most it will simply turn the strategy off (reduce the position size to zero) for a period.

For a more detailed description, see this post:

Improving Trading System Performance Using a Meta-Strategy

In this post I look at a meta-strategy that developed for a client’s strategy in S&P E-Mini futures.  What is extraordinary is that the underlying strategy was so badly designed (not by me!) and performs so poorly that no rational systematic trader would likely give it  a second look –  instead he would toss it into the large heap of failed ideas that all quantitative researchers accumulate over the course of their careers.  So this is a textbook example that illustrates the power of meta-strategies to improve, or in this case transform, the performance of an underlying strategy.

1. The Strategy

The Target Trader Strategy (“TTS”) is a futures strategy applied to S&P 500 E-Mini futures that produces a very high win rate, but which occasionally experiences very large losses. The purpose of the analysis if to find methods that will:

1) Decrease the max loss / drawdown
2) Increase the win rate / profitability

For longs the standard setting is entry 40 ticks below the target, stop loss 1000 ticks below the target, and then 2 re-entries 100 ticks below entry 1 and 100 ticks below entry 2

For shorts the standard is entry 80 ticks above the target. stop loss 1000 ticks above the target, and then 2 re-entries 100 ticks above entry 1 and 100 ticks above entry 2

For both directions its 80 ticks above/below for entry 1, 1000 tick stop, and then 1 re entry 100 ticks above/below, and then re-entry 2 100 ticks above/below entry 2

 

2. Strategy Performance

2.1 Overall Performance

The overall performance of the strategy over the period from 2018 to 2020 is summarized in the chart of the strategy equity curve and table of performance statistics below.
These confirm that, while the win rate if very high (over 84%) there strategy experiences many significant drawdowns, including a drawdown of -$61,412.50 (-43.58%). The total return is of the order of 5% per year, the strategy profit factor is fractionally above 1 and the Sharpe Ratio is negligibly small. Many traders would consider the performance to be highly unattractive.

 

 

 

2.2 Long Trades

We break the strategy performance down into long and short trades, and consider them separately. On the long side, the strategy has been profitable, producing a gain of over 36% during the period 2018-2020. It also suffered catastrophic drawdown of over -$97,000 during that period:

 


 

 

2.3 Short Trades

On the short side, the story is even worse, producing an overall loss of nearly -$59,000:

 

 

 

3. Improving Strategy Performance with a Meta-Strategy

We considered two possible methods to improve strategy performance. The first method attempts to apply technical indicators and other data series to improve trading performance. Here we evaluated price series such as the VIX index and a wide selection of technical indicators, including RSI, ADX, Moving Averages, MACD, ATR and others. However, any improvement in strategy performance proved to be temporary in nature and highly variable, in many cases amplifying the problems with the strategy performance rather than improving them.

The second approach proved much more effective, however. In this method we create a meta-strategy which effectively “trades the strategy”, turning it on and off depending on its recent performance. The meta-strategy consists of a set of rules that determines whether or not to continue trading the strategy after a series of wins or losses. In some cases the meta-strategy may increase the trade size for a sequence of trades, at times when it considers the conditions for the underlying strategy to be favorable.

The result of applying the meta-strategy are described in the following sections.

3.1 Long & Short Strategies with Meta-Strategy Overlay

The performance of the long/short strategies combined with the meta-strategy overlay are set out in the chart and table below.
The overall improvements can be summarized as follows:

  • Net profit increases from $15,387 to $176,287
  • Account return rises from 15% to 176%
  • Percentage win rate rises from 84% to 95%
  • Profit factor increases from 1.0 to 6.7
  • Average trade rises from $51 to $2,631
  • Max $ Drawdown falls from -$61,412 to -$30,750
  • Return/Max Drawdown ratio rises from 0.35 to 5.85
  •  The modified Sharpe ratio increases from 0.07 to 0.5

Taken together, these are dramatic improvements to every important aspect of strategy performance.

There are two key rules in the meta-strategy, applicable to winning and losing trades:

Rule for winning trades:
After 3 wins in a row, skip the next trade.

Rule for losing trades:
After 3 losses in a row, add 1 contract until the first win. Subtract 1 contract after each win until the next loss, or back to 1 contract.

 

 

 

 

3.2 Long Trades with Meta-Strategy

The meta-strategy rules produce significant improvements in the performance of both the long and short components of the strategy. On the long side the percentage win rate is increased to 100% and the max % drawdown is reduced to 0%:

 

 

3.3 Short Trades with Meta-Strategy

Improvements to the strategy on the short side are even more significant, transforming a loss of -$59,000 into a profit of $91,600:

 

 

 

 

4. Conclusion

A meta-strategy is a simple, yet powerful technique that can transform the performance of an underlying strategy.  The rules are often simple, although they can be challenging to implement.  Meta strategies can be applied to almost any underlying strategy, whether in futures, equities, or forex. Worthwhile improvements in strategy performance are often achievable, although not often as spectacular as in this case.

If any reader is interested in designing a meta-strategy for their own use, please get in contact.

Daytrading Index Futures Arbitrage

Trading with Indices

I have always been an advocate of incorporating index data into one’s trading strategies.  Since they are not tradable, the “market” in index products if often highly inefficient and displays easily identifiable patterns that can be exploited by a trader, or a trading system.  In fact, it is almost trivially easy to design “profitable” index trading systems and I gave a couple of examples in the post below, including a system producing stellar results in the S&P 500 Index.

 

http://jonathankinlay.com/2016/05/trading-with-indices/

Of course such systems are not directly useful.  But traders often use signals from such a system as a filter for an actual trading system.  So, for example, one might look for a correlated signal in the S&P 500 index as a means of filtering trades in the E-Mini futures market or theSPDR S&P 500 ETF (SPY).

Multi-Strategy Trading Systems

This is often as far as traders will take the idea, since it quickly gets a lot more complicated and challenging to build signals generated from an index series into the logic of a strategy designed for related, tradable market. And for that reason, there is a great deal of unexplored potential in using index data in this way.  So, for instance, in the post below I discuss a swing trading system in the S&P500 E-mini futures (ticker: ES) that comprises several sub-systems build on prime-valued time intervals.  This has the benefit of minimizing the overlap between signals from multiple sub-systems, thereby increasing temporal diversification.

http://jonathankinlay.com/2018/07/trading-prime-market-cycles/

A critical point about this system is that each of sub-systems trades the futures market based on data from both the E-mini contract and the S&P 500 cash index.  A signal is generated when the system finds particular types of discrepancy between the cash index and corresponding futures, in a quasi risk-arbitrage.

SSALGOTRADING AD

Arbing the NASDAQ 100 Index Futures

Developing trading systems for the S&P500 E-mini futures market is not that hard.  A much tougher challenge, at least in my experience, is presented by the E-mini NASDAQ-100 futures (ticker: NQ).  This is partly to do with the much smaller tick size and different market microstructure of the NASDAQ futures market. Additionally, the upward drift in equity related products typically favors strategies that are long-only.  Where a system trades both long and short sides of the market, the performance on the latter is usually much inferior.  This can mean that the strategy performs poorly in bear markets such as 2008/09 and, for the tech sector especially, the crash of 2000/2001.  Our goal was to develop a daytrading system that might trade 1-2 times a week, and which would perform as well or better on short trades as on the long side.  This is where NASDAQ 100 index data proved to be especially helpful.  We found that discrepancies between the cash index and futures market gave particularly powerful signals when markets seemed likely to decline.  Using this we were able to create a system that performed exceptionally well during the most challenging market conditions. It is notable that, in the performance results below (for a single futures contract, net of commissions and slippage), short trades contributed the greater proportion of total profits, with a higher overall profit factor and average trade size.

EC

Annual PL

PL

Conclusion: Using Index Data, Or Other Correlated Signals, Often Improves Performance

It is well worthwhile investigating how non-tradable index data can be used in a trading strategy, either as a qualifying signal or, more directly, within the logic of the algorithm itself.  The greater challenge of building such systems means that there are opportunities to be found, even in well-mined areas like index futures markets.  A parallel idea that likewise offers plentiful opportunity is in designing systems that make use of data on multiple time frames, and in correlated markets, for instance in the energy sector.Here one can identify situations in which, under certain conditions, one market has a tendency to lead another, a phenomenon referred to as Granger Causality.

 

Trading Prime Market Cycles

Magicicada tredecassini NC XIX male dorsal trim.jpg

Magicicada is the genus of the 13-year and 17-year periodical cicadas of eastern North America. Magicicada species spend most of their 13- and 17-year lives underground feeding on xylem fluids from the roots of deciduous forest trees in the eastern United States.  After 13 or 17 years, mature cicada nymphs emerge in the springtime at any given locality, synchronously and in tremendous numbers.  Within two months of the original emergence, the lifecycle is complete, the eggs have been laid, and the adult cicadas are gone for another 13 or 17 years.

The emergence period of large prime numbers (13 and 17 years) has been hypothesized to be a predator avoidance strategy adopted to eliminate the possibility of potential predators receiving periodic population boosts by synchronizing their own generations to divisors of the cicada emergence period. If, for example, the cycle length was, say, 12 years, then the species would be exposed to predators regenerating over cycles of 2, 3, 4, or 6 years.  Limiting their cycle to a large prime number reduces the variety of predators the species is likely to face.

SSALGOTRADING AD

Prime Cycles in Trading Strategies

What has any of this to do with trading?  When building a strategy in a particular market we might start by creating a model that works reasonably well on, say, 5-minute bars. Then, in order to improve the risk-adjusted returns we might try create a second sub-strategy on a different frequency.  This will hopefully result in a new series of signals, an increase in the number of trades, and corresponding improvement in the risk-adjusted returns of the overall strategy.  This phenomenon is referred to as temporal diversification.

What time frequency should we select for our second sub-strategy?  There are many factors to consider, of course, but one of them is that we would like to see as few duplicate signals between the two sub-strategies.  Otherwise we will simply be replicating trades, rather than reducing the overall level of strategy risk through temporal diversification.  The best way to minimize the overlap in signals generated by multiple sub-strategies is to use prime number bar frequencies (5 minute, 7 minute, 11 minute, etc).

S&P500 Swing Trading Strategy

An example of this approach is our EMini Swing Trading strategy which we operate on our Systematic Algotrading Platform.  This strategy is actually a combination of several different sub-strategies that operate on 5-minute, 11-minute, 17-minute and 31-minute bars.  Each strategy focuses on a different set of characteristics of the S&P 500 futures market, but the key point here is that the trading signals very rarely overlap and indeed several of the sub-strategies have a low correlation.

correl

 

The resulting increase in trade frequency and temporal diversification produces very attractive risk-adjusted performance: after an exceptional year in 2017 which saw a 78.58% net return, the strategy is already at  +60% YTD in 2018 and showing no sign of slowing down.

Investors can auto-trade the E-Mini Swing Trading strategy and many other strategies in their own account – see the Leaderboard for more details.

Perf1Monthly returns

A Simple Momentum Strategy

Momentum trading strategies span a diverse range of trading ideas.  Often they will use indicators to determine the recent underlying trend and try to gauge the strength of the trend using measures of the rate of change in the price of the asset.

One very simple momentum concept, a strategy in S&P500 E-Mini futures, is described in the following blog post:

Buy When S&P 500 Makes New Intraday High?

The basic idea is to buy the S&P500 E-Mini futures when the contract makes a new intraday high.  This is subject to the qualification that the Internal Bar Strength fall below a selected threshold level.  In order words, after a period of short-term weakness – indicated by the low reading of the Internal Bar Strength – we buy when the futures recover to make a new intraday high, suggesting continued forward momentum.

IBS is quite a useful trading indicator, which you can learn more about in these posts:

http://jonathankinlay.com/2016/06/the-internal-bar-strength-indicator/

http://jonathankinlay.com/2016/06/quick-note-internal-bar-strength-stationarity/

 

I have developed a version of the intraday-high strategy, using parameters to generalize it and allow for strategy optimization.  The Easylanguage code for my version of the strategy is as follows:

Inputs:
nContracts(1),
ndaysHigh(5),
IBSlag(1),
IBStrigger(0.15);

Vars:

IBS(0.5);

If H[IBSlag] > L[IBSlag] then
Begin
IBS=(H[IBSlag]-C[IBSlag])/(H[IBSlag]-L[IBSlag]);
end;
If (IBS <= IBStrigger) and (H[0] >= Highest(High, ndaysHigh)) then
begin
Buy nContracts contracts this bar on close;
end;

If C[0] > H[1] then
begin
Sell all contracts this bar on close;
end;

The performance results for the strategy appear quite promising, despite the downturn in strategy profitability in 2018 to date (all performance results are net of slippage and commission):

 

Fig1 Fig3

Fig2

 

SSALGOTRADING AD

Robustness Testing with Walk Forward Optimization

We evaluate the robustness of the strategy using the  Walk Forward Optimization feature in Tradestation.  Walk forward analysis is the process of optimizing a trading system using a limited set of parameters, and then testing the best optimized parameter set on out-of-sample data. This process is similar to how a trader would use an automated trading system in real live trading. The in-sample time window is shifted forward by the period covered by the out-of-sample test, and the process is repeated. At the end of the test, all of the recorded results are used to assess the trading strategy.

In other words, walk forward analysis does optimization on a training set; tests on a period after the set and then rolls it all forward and repeats the process. This gives a larger out-of-sample period and allows the system developer to see how stable the system is over time.

The  image below illustrates the walk forward analysis procedure. An optimization is performed over a longer period (the in-sample data), and then the optimized parameter set is tested over a subsequent shorter period (the out-of-sample data). The optimization and testing periods are shifted forward, and the process is repeated until a suitable sample size is achieved.

 

WFO

 

Tradestation enables the user to run a battery of WFO tests, using different size in-sample and out-of-sample sizes and number of runs.  The outcome of each test is evaluated on several specific criteria such as the net profit and drawdown and only if the system meets all of the criteria is the test designated as a “Pass”.  This gives the analyst a clear sense of the robustness of his strategy across multiple periods and sample sizes.

A WFO cluster analysis summary for the momentum strategy is illustrated below.  The cluster test is designated as “Failed” overall, since the strategy failed to meet the test criteria for a preponderance of the individual walk-forward tests.  The optimal parameters found in each test vary considerably over the sample periods spanning 2003-2018, giving concerns about the robustness of the strategy under changing market conditions.

Fig4

 

Improving the Strategy

We can improve both the performance and robustness of our simple momentum strategy by combining it with several other trend and momentum indicators. One such example is illustrated in the performance charts and tables below.  The strategy has performed well in both bull and bear markets and in both normal and volatile market conditions:

 

Fig5 Fig6

Fig7

A WFO cluster analysis indicates that the revised momentum strategy is highly robust to the choice of sample size and strategy parameters, as it passes every test in the 30-cell WFO analysis cluster table:

Fig8

 

Conclusion

Momentum strategies are well known and easy to develop using standard methodologies, such as the simple indicators used in this example. They tend to work well in most equity index futures markets, and in some commodity markets too.  One of their big drawbacks, however, is that they typically go through periods of poor performance and need to be tested thoroughly for robustness in order to ensure satisfactory results under the full range of market conditions.

Systematic Futures Trading

In its proprietary trading, Systematic Strategies primary focus in on equity and volatility strategies, both low and high frequency. In futures, the emphasis is on high frequency trading, although we also run one or two lower frequency strategies that have higher capacity, such as the Futures WealthBuilder. The version of WealthBuilder running on the Collective 2 site has performed very well in 2017, with net returns of 30% and a Sharpe Ratio of 3.4:

Futures C2 oct 2017

 

In the high frequency space, our focus is on strategies with very high Sharpe Ratios and low drawdowns. We trade a range of futures products, including equity, fixed income, metals and energy markets. Despite the current low levels of market volatility, these strategies have performed well in 2017:

HFT Futures Oct 2017 (NFA)

Building high frequency strategies with double-digit Sharpe Ratios requires a synergy of computational capability and modeling know-how. The microstructure of futures markets is, of course, substantially different to that of equity or forex markets and the components of the model that include microstructure effects vary widely from one product to another. There can be substantial variations too in the way that time is handled in the model – whether as discrete or continuous “wall time”, in trade time, or some other measure. But some of the simple technical indicators we use – moving averages, for example – are common to many models across different products and markets. Machine learning plays a role in most of our trading strategies, including high frequency.

Here are some relevant blog posts that you may find interesting:

http://jonathankinlay.com/2016/04/high-frequency-trading-equities-vs-futures/

 

http://jonathankinlay.com/2015/05/designing-scalable-futures-strategy/

 

http://jonathankinlay.com/2014/10/day-trading-system-in-vix-futures/

Futures WealthBuilder – June 2017: +4.4%

The Futures WealthBuilder product is an algorithmic CTA strategy that trades several highly liquid futures contracts using machine learning algorithms.  More details about the strategy are given in this blog post.

We offer a version of the strategy on the Collective 2 site (see here for details) that the user can subscribe to for a very modest fee of only $149 per month.  The Collective 2 version of the strategy is unlikely to perform as well as the product we offer in our Systematic Strategies Fund, which trades a much wider range of futures products.  But the strategy is off to an excellent start, making +4.4% in June and is now up 6.7% since inception in May.  In June the strategy made profitable trades in US Bonds, Euro F/X and VIX futures, and the last seven trades in a row have been winners.

You can find full details of the strategy, including a listing of all of the trades, on the Collective 2 site.

Subscribers can sign up for a free, seven day trial and thereafter they can choose to trade the strategy automatically in their own brokerage account, using the Collective 2 api.

Futures WealthBuilder June 2017

Futures WealthBuilder

We are launching a new product, the Futures WealthBuilder,  a CTA system that trades futures contracts in several highly liquid financial and commodity markets, including SP500 EMinis, Euros, VIX, Gold, US Bonds, 10-year and five-year notes, Corn, Natural Gas and Crude Oil.  Each  component strategy uses a variety of machine learning algorithms to detect trends, seasonal effects and mean-reversion.  We develop several different types of model for each market, and deploy them according to their suitability for current market conditions.

Performance of the strategy (net of fees) since 2013 is detailed in the charts and tables below.  Notable features include a Sharpe Ratio of just over 2, an annual rate of return of 190% on an account size of $50,000, and a maximum drawdown of around 8% over the last three years.  It is worth mentioning, too, that the strategy produces approximately equal rates of return on both long and short trades, with an overall profit factor above 2.

 

Fig1

 

Fig2

 

 

Fig3

Fig4

 

Fig5

Low Correlation

Despite a high level of correlation between several of the underlying markets, the correlation between the component strategies of Futures WealthBuilder are, in the majority of cases, negligibly small (with a few exceptions, such as the high correlation between the 10-year and 5-year note strategies).  This accounts for the relative high level of return in relation to portfolio risk, as measured by the Sharpe Ratio.   We offer strategies in both products chiefly as a mean of providing additional liquidity, rather than for their diversification benefit.

Fig 6

Strategy Robustness

Strategy robustness is a key consideration in the design stage.  We use Monte Carlo simulation to evaluate scenarios not seen in historical price data in order to ensure consistent performance across the widest possible range of market conditions.  Our methodology introduces random fluctuations to historical prices, increasing or decreasing them by as much as 30%.  We allow similar random fluctuations in that value strategy parameters, to ensure that our models perform consistently without being overly-sensitive to the specific parameter values we have specified.  Finally, we allow the start date of each sub-system to vary randomly by up to a year.

The effect of these variations is to produce a wide range of outcomes in terms of strategy performance.  We focus on the 5% worst outcomes, ranked by profitability, and select only those strategies whose performance is acceptable under these adverse scenarios.  In this way we reduce the risk of overfitting the models while providing more realistic expectations of model performance going forward.  This procedure also has the effect of reducing portfolio tail risk, and the maximum peak-to-valley drawdown likely to be produced by the strategy in future.

GC Daily Stress Test

Futures WealthBuilder on Collective 2

We will be running a variant of the Futures WealthBuilder strategy on the Collective 2 site, using a subset of the strategy models in several futures markets(see this page for details).  Subscribers will be able to link and auto-trade the strategy in their own account, assuming they make use of one of the approved brokerages which include Interactive Brokers, MB Trading and several others.

Obviously the performance is unlikely to be as good as the complete strategy, since several component sub-strategies will not be traded on Collective 2.  However, this does give the subscriber the option to trial the strategy in simulation before plunging in with real money.

Fig7

 

 

 

 

 

High Frequency Scalping Strategies

HFT scalping strategies enjoy several highly desirable characteristics, compared to low frequency strategies.  A case in point is our scalping strategy in VIX futures, currently running on the Collective2 web site:

  • The strategy is highly profitable, with a Sharpe Ratio in excess of 9 (net of transaction costs of $14 prt)
  • Performance is consistent and reliable, being based on a large number of trades (10-20 per day)
  • The strategy has low, or negative correlation to the underlying equity and volatility indices
  • There is no overnight risk

 

VIX HFT Scalper

 

Background on HFT Scalping Strategies

The attractiveness of such strategies is undeniable.  So how does one go about developing them?

It is important for the reader to familiarize himself with some of the background to  high frequency trading in general and scalping strategies in particular.  Specifically, I would recommend reading the following blog posts:

http://jonathankinlay.com/2015/05/high-frequency-trading-strategies/

http://jonathankinlay.com/2014/05/the-mathematics-of-scalping/

 

Execution vs Alpha Generation in HFT Strategies

The key to understanding HFT strategies is that execution is everything.  With low frequency strategies a great deal of work goes into researching sources of alpha, often using highly sophisticated mathematical and statistical techniques to identify and separate the alpha signal from the background noise.  Strategy alpha accounts for perhaps as much as 80% of the total return in a low frequency strategy, with execution making up the remaining 20%.  It is not that execution is unimportant, but there are only so many basis points one can earn (or save) in a strategy with monthly turnover.  By contrast, a high frequency strategy is highly dependent on trade execution, which may account for 80% or more of the total return.  The algorithms that generate the strategy alpha are often very simple and may provide only the smallest of edges.  However, that very small edge, scaled up over thousands of trades, is sufficient to produce a significant return. And since the risk is spread over a large number of very small time increments, the rate of return can become eye-wateringly high on a risk-adjusted basis:  Sharpe Ratios of 10, or more, are commonly achieved with HFT strategies.

In many cases an HFT algorithm seeks to estimate the conditional probability of an uptick or downtick in the underlying, leaning on the bid or offer price accordingly.  Provided orders can be positioned towards the front of the queue to ensure an adequate fill rate, the laws of probability will do the rest.  So, in the HFT context, much effort is expended on mitigating latency and on developing techniques for establishing and maintaining priority in the limit order book.  Another major concern is to monitor order book dynamics for signs that book pressure may be moving against any open orders, so that they can be cancelled in good time, avoiding adverse selection by informed traders, or a buildup of unwanted inventory.

In a high frequency scalping strategy one is typically looking to capture an average of between 1/2 to 1 tick per trade.  For example, the VIX scalping strategy illustrated here averages around $23 per contract per trade, i.e. just under 1/2 a tick in the futures contract.  Trade entry and exit is effected using limit orders, since there is no room to accommodate slippage in a trading system that generates less than a single tick per trade, on average. As with most HFT strategies the alpha algorithms are only moderately sophisticated, and the strategy is highly dependent on achieving an acceptable fill rate (the proportion of limit orders that are executed).  The importance of achieving a high enough fill rate is clearly illustrated in the first of the two posts referenced above.  So what is an acceptable fill rate for a HFT strategy?

Fill Rates

I’m going to address the issue of fill rates by focusing on a critical subset of the problem:  fills that occur at the extreme of the bar, also known as “extreme hits”. These are limit orders whose prices coincide with the highest (in the case of a sell order) or lowest (in the case of a buy order) trade price in any bar of the price series. Limit orders at prices within the interior of the bar are necessarily filled and are therefore uncontroversial.  But limit orders at the extremities of  the bar may or may not be filled and it is therefore these orders that are the focus of attention.

By default, most retail platform backtest simulators assume that all limit orders, including extreme hits, are filled if the underlying trades there.  In other words, these systems typically assume a 100% fill rate on extreme hits.  This is highly unrealistic:  in many cases the high or low of a bar forms a turning point that the price series visits only fleetingly before reversing its recent trend, and does not revisit for a considerable time.  The first few orders at the front of the queue will be filled, but many, perhaps the majority of, orders further down the priority order will be disappointed.  If the trader is using a retail trading system rather than a HFT platform to execute his trades, his limit orders are almost always guaranteed to rest towards the back of the queue, due to the relatively high latency  of his system.  As a result, a great many of his limit orders – in particular, the extreme hits – will not be filled.

The consequences of missing a large number of trades due to unfilled limit orders are likely to be catastrophic for any HFT strategy. A simple test that is readily available  in most backtest systems is to change the underlying assumption with regard to the fill rate on extreme hits – instead of assuming that 100% of such orders are filled, the system is able to test the outcome if limit orders are filled only if the price series subsequently exceeds the limit price.  The outcome produced under this alternative scenario is typically extremely adverse, as illustrated in first blog post referenced previously.

 

Fig4

In reality, of course, neither assumption is reasonable:  it is unlikely that either 100% or 0% of a strategy’s extreme hits will be filled – the actual fill rate will likely lie somewhere between these two outcomes.   And this is the critical issue:  at some level of fill rate the strategy will move from profitability into unprofitability.  The key to implementing a HFT scalping strategy successfully is to ensure that the execution falls on the right side of that dividing line.

Implementing HFT Scalping Strategies in Practice

One solution to the fill rate problem is to spend millions of dollars building HFT infrastructure.  But for the purposes of this post let’s assume that the trader is confined to using a retail trading platform like Tradestation or Interactive Brokers.  Are HFT scalping systems still feasible in such an environment?  The answer, surprisingly, is a qualified yes – by using a technique that took me many years to discover.

To illustrate the method I will use the following HFT scalping system in the E-Mini S&P500 futures contract.  The system trades the E-Mini futures on 3 minute bars, with an average hold time of 15 minutes.  The average trade is very low – around $6, net of commissions of $8 prt.  But the strategy appears to be highly profitable ,due to the large number of trades – around 50 to 60 per day, on average.


fig-4

fig-3

So far so good.  But the critical issue is the very large number of extreme hits produced by the strategy.  Take the trading activity on 10/18 as an example (see below).  Of 53 trades that day, 25 (47%) were extreme hits, occurring at the high or low price of the 3-minute bar in which the trade took place.

 

fig5

 

Overall, the strategy extreme hit rate runs at 34%, which is extremely high.  In reality, perhaps only 1/4 or 1/3 of these orders will actually execute – meaning that remainder, amounting to around 20% of the total number of orders, will fail.  A HFT scalping strategy cannot hope to survive such an outcome.  Strategy profitability will be decimated by a combination of missed, profitable trades and  losses on trades that escalate after an exit order fails to execute.

So what can be done in such a situation?

Manual Override, MIT and Other Interventions

One approach that will not work is to assume naively that some kind of manual oversight will be sufficient to correct the problem.  Let’s say the trader runs two versions of the system side by side, one in simulation and the other in production.  When a limit order executes on the simulation system, but fails to execute in production, the trader might step in, manually override the system and execute the trade by crossing the spread.  In so doing the trader might prevent losses that would have occurred had the trade not been executed, or force the entry into a trade that later turns out to be profitable.  Equally, however, the trader might force the exit of a trade that later turns around and moves from loss into profit, or enter a trade that turns out to be a loser.  There is no way for the trader to know, ex-ante, which of those scenarios might play out.  And the trader will have to face the same decision perhaps as many as twenty times a day.  If the trader is really that good at picking winners and cutting losers he should scrap his trading system and trade manually!

An alternative approach would be to have the trading system handle the problem,  For example, one could program the system to convert limit orders to market orders if a trade occurs at the limit price (MIT), or after x seconds after the limit price is touched.  Again, however, there is no way to know in advance whether such action will produce a positive outcome, or an even worse outcome compared to leaving the limit order in place.

In reality, intervention, whether manual or automated, is unlikely to improve the trading performance of the system.  What is certain, however,  is that by forcing the entry and exit of trades that occur around the extreme of a price bar, the trader will incur additional costs by crossing the spread.  Incurring that cost for perhaps as many as 1/3 of all trades, in a system that is producing, on average less than half a tick per trade, is certain to destroy its profitability.

Successfully Implementing HFT Strategies on a Retail Platform

For many years I assumed that the only solution to the fill rate problem was to implement scalping strategies on HFT infrastructure.  One day, I found myself asking the question:  what would happen if we slowed the strategy down?  Specifically, suppose we took the 3-minute E-Mini strategy and ran it on 5-minute bars?

My first realization was that the relative simplicity of alpha-generation algorithms in HFT strategies is an advantage here.  In a low frequency context, the complexity of the alpha extraction process mitigates its ability to generalize to other assets or time-frames.  But HFT algorithms are, by and large, simple and generic: what works on 3-minute bars for the E-Mini futures might work on 5-minute bars in E-Minis, or even in SPY.  For instance, if the essence of the algorithm is something as simple as: “buy when the price falls by more than x% below its y-bar moving average”, that approach might work on 3-minute, 5-minute, 60-minute, or even daily bars.

So what happens if we run the E-mini scalping system on 5-minute bars instead of 3-minute bars?

Obviously the overall profitability of the strategy is reduced, in line with the lower number of trades on this slower time-scale.   But note that average trade has increased and the strategy remains very profitable overall.

fig8 fig9

More importantly, the average extreme hit rate has fallen from 34% to 22%.

fig6

Hence, not only do we get fewer, slightly more profitable trades, but a much lower proportion of them occur at the extreme of the 5-minute bars.  Consequently the fill-rate issue is less critical on this time frame.

Of course, one can continue this process.  What about 10-minute bars, or 30-minute bars?  What one tends to find from such experiments is that there is a time frame that optimizes the trade-off between strategy profitability and fill rate dependency.

However, there is another important factor we need to elucidate.  If you examine the trading record from the system you will see substantial variation in the extreme hit rate from day to day (for example, it is as high as 46% on 10/18, compared to the overall average of 22%).  In fact, there are significant variations in the extreme hit rate during the course of each trading day, with rates rising during slower market intervals such as from 12 to 2pm.  The important realization that eventually occurred to me is that, of course, what matters is not clock time (or “wall time” in HFT parlance) but trade time:  i.e. the rate at which trades occur.

Wall Time vs Trade Time

What we need to do is reconfigure our chart to show bars comprising a specified number of trades, rather than a specific number of minutes.  In this scheme, we do not care whether the elapsed time in a given bar is 3-minutes, 5-minutes or any other time interval: all we require is that the bar comprises the same amount of trading activity as any other bar.  During high volume periods, such as around market open or close, trade time bars will be shorter, comprising perhaps just a few seconds.  During slower periods in the middle of the day, it will take much longer for the same number of trades to execute.  But each bar represents the same level of trading activity, regardless of how long a period it may encompass.

How do you decide how may trades per bar you want in the chart?

As a rule of thumb, a strategy will tolerate an extreme hit rate of between 15% and 25%, depending on the daily trade rate.  Suppose that in its original implementation the strategy has an unacceptably high hit rate of 50%.  And let’s say for illustrative purposes that each time-bar produces an average of 1, 000 contracts.  Since volatility scales approximately with the square root of time, if we want to reduce the extreme hit rate by a factor of 2, i.e. from 50% to 25%, we need to increase the average number of trades per bar by a factor of 2^2, i.e. 4.  So in this illustration we would need volume bars comprising 4,000 contracts per bar.  Of course, this is just a rule of thumb – in practice one would want to implement the strategy of a variety of volume bar sizes in a range from perhaps 3,000 to 6,000 contracts per bar, and evaluate the trade-off between performance and fill rate in each case.

Using this approach, we arrive at a volume bar configuration for the E-Mini scalping strategy of 20,000 contracts per bar.  On this “time”-frame, trading activity is reduced to around 20-25 trades per day, but with higher win rate and average trade size.  More importantly, the extreme hit rate runs at a much lower average of 22%, which means that the trader has to worry about maybe only 4 or 5 trades per day that occur at the extreme of the volume bar.  In this scenario manual intervention is likely to have a much less deleterious effect on trading performance and the strategy is probably viable, even on a retail trading platform.

(Note: the results below summarize the strategy performance only over the last six months, the time period for which volume bars are available).

 

fig7

 

fig10 fig11

Concluding Remarks

We have seen that is it feasible in principle to implement a HFT scalping strategy on a retail platform by slowing it down, i.e. by implementing the strategy on bars of lower frequency.  The simplicity of many HFT alpha generation algorithms often makes them robust to generalization across time frames (and sometimes even across assets).  An even better approach is to use volume bars, or trade-time, to implement the strategy.  You can estimate the appropriate bar size using the square root of time rule to adjust the bar volume to produce the requisite fill rate.  An extreme hit rate if up to 25% may be acceptable, depending on the daily trade rate, although a hit rate in the range of 10% to 15% would typically be ideal.

Finally, a word about data.  While necessary compromises can be made with regard to the trading platform and connectivity, the same is not true for market data, which must be of the highest quality, both in terms of timeliness and completeness. The reason is self evident, especially if one is attempting to implement a strategy in trade time, where the integrity and latency of market data is crucial. In this context, using the data feed from, say, Interactive Brokers, for example, simply will not do – data delivered in 500ms packets in entirely unsuited to the task.  The trader must seek to use the highest available market data feed that he can reasonably afford.

That caveat aside, one can conclude that it is certainly feasible to implement high volume scalping strategies, even on a retail trading platform, providing sufficient care is taken with the modeling and implementation of the system.

Trading With Indices

In this post I want to discuss ways to make use of signals from relevant market indices in your trading.  These signals can add value regardless of whether you trade algorithmically or manually.  The techniques described here are one of the most widely applicable in the quantitative analyst’s arsenal.

Let’s motivate the discussion by looking an example of a simple trading system trading the VIX on weekly bars.  Performance results for the system are summarized in the chart and table below.  The system outperforms the buy and hold return by a substantial margin, with a profit factor of over 3 and a win rate exceeding 82%.  What’s not to like?

VIX EC

VIX Performance

Well, for one thing, this isn’t really a trading system – because the VIX Index itself isn’t tradable. So the performance results are purely notional (and, if you didn’t already notice, no slippage or commission is included).

It is very easy to build high-performing trading system in indices – because they are not traded products,  index prices are often stale and tend to “follow” the price action in the equivalent traded market.

This particular system for the VIX Index took me less than ten minutes to develop and comprises only a few lines of code.  The system makes use of a simple RSI indicator to decide when to buy or sell the index.  I optimized the indicator parameters (separately for long and short) over the period to 2012, and tested it out-of-sample on the data from 2013-2016.

inputs:
Price( Close ) ,
Length( 14 ) ,
OverSold( 30 ) ;

variables:
RSIValue( 0 );

RSIValue = RSI( Price, Length );
if CurrentBar > 1 and RSIValue crosses over OverSold then
Buy ( !( “RsiLE” ) ) next bar at market;

.

The daily system I built for the S&P 500 Index is a little more sophisticated than the VIX model, and produces the following results.

SP500 EC

SP500 Perf

 

Using Index Trading Systems

We have seen that its trivially easy to build profitable trading systems for index products.  But since they can’t be traded, what’s the point?

The analyst might be tempted by the idea of using the signals generated by an index trading system to trade a corresponding market, such as VIX or eMini futures.  However, this approach is certain to fail.  Index prices lag the prices of equivalent futures products, where traders first monetize their view on the market.  So using an index strategy directly to trade a cash or futures market would be like trying to trade using prices delayed by a few seconds, or minutes – a recipe for losing money.

SSALGOTRADING AD

Nor is it likely that a trading system developed for an index product will generalize to a traded market.  What I mean by this is that if you were to take an index strategy, such as the VIX RSI strategy, transfer it to VIX futures and tweak the parameters in the hope of producing a profitable system, you are likely to be disappointed. As I have shown, you can produce a profitable index trading system using the simplest and most antiquated trading concepts (such as the RSI index) that long ago ceased to offer any predictive value in actual traded markets.  Index markets are actually inefficient – the prices of index products often fail to fully reflect all relevant, available information in a timely way. Such simple inefficiencies are easily revealed by indicators such as moving averages.  Traded markets, by contrast, are highly efficient and, with the exception of HFT, it is going to take a great deal more than a simple moving average to provide insight into the few inefficiencies that do arise.

bullbear

Strategies in index products are best thought of, not as trading strategies, but rather as a means of providing broad guidance as to the general condition of the market and its likely direction over the longer term.  To take the VIX index strategy as an example, you can see that each “trade” spans several weeks.  So one might regard a “buy” signal from the VIX index system as an indication that volatility is expected to rise over the next month or two.  A trader might use that information to lean on the side of being long volatility, perhaps even avoiding any short volatility positions altogether for the next several weeks.  Following the model’s guidance in that way would would certainly have helped many equity and volatility traders during the market sell off during August 2015, for example:

 

Vix Example

The S&P 500 Index model is one I use to provide guidance as to market conditions for the current trading day.  It is a useful input to my thinking as to how aggressive I want my trading models to be during the upcoming session. If the index model suggests a positive tone to the market, with muted volatility, I might be inclined to take a more aggressive stance.  If the model starts trading to the short side, however, I am likely to want to be much more cautious.    Yesterday (May 16, 2016), for example, the index model took an early long trade, providing confirmation of the positive tenor to the market and encouraging me to trade volatility to the short side more aggressively.

 

SP500 Example

 

 

In general, I would tend to classify index trading systems as “decision support” tools that provide a means of shading opinion on the market, or perhaps providing a means of calibrating trading models to the anticipated market conditions. However, they can be used in a more direct way, short of actual trading.  For example, one of our volatility trading systems uses the trading signals from a trading system designed for the VVIX volatility-of-volatility index.  Another approach is to use the signals from an index trading system as an indicator of the market regime in a regime switching model.

Designing Index Trading Models

Whereas it is profitability that is typically the primary design criterion for an actual trading system, given the purpose of an index trading system there are other criteria that are at least as important.

It should be obvious from these few illustrations that you want to design your index model to trade less frequently than the system you are intending to trade live: if you are swing-trading the eminis on daily bars, it doesn’t help to see 50 trades a day from your index system.  What you want is an indication as to whether the market action over the next several days is likely to be positive or negative.  This means that, typically, you will design your index system using bar frequencies at least as long as for your live system.

Another way to slow down the signals coming from your index trading system is to design it for very high accuracy – a win rate of  70%, or higher.  It is actually quite easy to do this:  I have systems that trade the eminis on daily bars that have win rates of over 90%.  The trick is simply that you have to be prepared to wait a long time for the trade to come good.  For a live system that can often be a problem – no-one like to nurse an underwater position for days or weeks on end.  But for an index trading system it matters far less and, in fact, it helps:  because you want trading signals over longer horizons than the time intervals you are using in your live trading system.

Since the index system doesn’t have to trade live, it means of course that the usual trading costs and frictions do not apply.  The advantage here is that you can come up with concepts for trading systems that would be uneconomic in the real world, but which work perfectly well in the frictionless world of index trading.  The downside, however, is that this might lead you to develop index systems that trade far too frequently.  So, even though they should not apply, you might seek to introduce trading costs in order to penalize higher frequency trading systems and benefit systems that trade less frequently.

Designing index trading systems in an area in which genetic programming algorithms excel.  There are two main reasons for this.  Firstly, as I have previously discussed, simple technical indicators of the kind employed by GP modeling systems work well in index markets.  Secondly, and more importantly, you can use the GP system to tailor an index trading system to meet the precise criteria you have in mind, such as the % win rate, trading frequency, etc.

An outstanding product that I can highly recommend in this context is Mike Bryant’s Adaptrade Builder.  Builder is a superb piece of software whose power and ease of use reflects Mike’s engineering background and systems development expertise.


Adaptrade

 

 

High Frequency Trading: Equities vs. Futures

A talented young system developer I know recently reached out to me with an interesting-looking equity curve for a high frequency strategy he had designed in E-mini futures:

Fig1

Pretty obviously, he had been making creative use of the “money management” techniques so beloved by futures systems designers.  I invited him to consider how it would feel to be trading a 1,000-lot E-mini position when the market took a 20 point dive.  A $100,000 intra-day drawdown might make the strategy look a little less appealing.  On the other hand, if you had already made millions of dollars in the strategy, you might no longer care so much.

SSALGOTRADING AD

A more important criticism of money management techniques is that they are typically highly path-dependent:  if you had started your strategy slightly closer to one of the drawdown periods that are almost unnoticeable on the chart, it could have catastrophic consequences for your trading account.  The only way to properly evaluate this, I advised, was to backtest the strategy over many hundreds of thousands of test-runs using Monte Carlo simulation.  That would reveal all too clearly that the risk of ruin was far larger than might appear from a single backtest.

Next, I asked him whether the strategy was entering and exiting passively, by posting bids and offers, or aggressively, by crossing the spread to sell at the bid and buy at the offer.  I had a pretty good idea what his answer would be, given the volume of trades in the strategy and, sure enough he confirmed the strategy was using passive entries and exits.  Leaving to one side the challenge of executing a trade for 1,000 contracts in this way, I instead ask him to show me the equity curve for a single contract in the underlying strategy, without the money-management enhancement. It was still very impressive.

Fig2

 

The Critical Fill Assumptions For Passive Strategies

But there is an underlying assumption built into these results, one that I have written about in previous posts: the fill rate.  Typically in a retail trading platform like Tradestation the assumption is made that your orders will be filled if a trade occurs at the limit price at which the system is attempting to execute.  This default assumption of a 100% fill rate is highly unrealistic.  The system’s orders have to compete for priority in the limit order book with the orders of many thousands of other traders, including HFT firms who are likely to beat you to the punch every time.  As a consequence, the actual fill rate is likely to be much lower: 10% to 20%, if you are lucky.  And many of those fills will be “toxic”:  buy orders will be the last to be filled just before the market  moves lower and sell orders will be the last to get filled just as the market moves higher. As a result, the actual performance of the strategy will be a very long way from the pretty picture shown in the chart of the hypothetical equity curve.

One way to get a handle on the problem is to make a much more conservative assumption, that your limit orders will only get filled when the market moves through them.  This can easily be achieved in a product like Tradestation by selecting the appropriate backtest option:

fig3

 

The strategy performance results often look very different when this much more conservative fill assumption is applied.  The outcome for this system was not at all unusual:

Fig4

 

Of course, the more conservative assumption applied here is also unrealistic:  many of the trading system’s sell orders would be filled at the limit price, even if the market failed to move higher (or lower in the case of a buy order).  Furthermore, even if they were not filled during the bar-interval in which they were issued, many limit orders posted by the system would be filled in subsequent bars.  But the reality is likely to be much closer to the outcome assuming a conservative fill-assumption than an optimistic one.    Put another way:  if the strategy demonstrates good performance under both pessimistic and optimistic fill assumptions there is a reasonable chance that it will perform well in practice, other considerations aside.

An Example of a HFT Equity Strategy

Let’s contrast the futures strategy with an example of a similar HFT strategy in equities.  Under the optimistic fill assumption the equity curve looks as follows:

Fig5

Under the more conservative fill assumption, the equity curve is obviously worse, but the strategy continues to produce excellent returns.  In other words, even if the market moves against the system on every single order, trading higher after a sell order is filled, or lower after a buy order is filled, the strategy continues to make money.

Fig6

Market Microstructure

There is a fundamental reason for the discrepancy in the behavior of the two strategies under different fill scenarios, which relates to the very different microstructure of futures vs. equity markets.   In the case of the E-mini strategy the average trade might be, say, $50, which is equivalent to only 4 ticks (each tick is worth $12.50).  So the average trade: tick size ratio is around 4:1, at best.  In an equity strategy with similar average trade the tick size might be as little as 1 cent.  For a futures strategy, crossing the spread to enter or exit a trade more than a handful of times (or missing several limit order entries or exits) will quickly eviscerate the profitability of the system.  A HFT system in equities, by contrast, will typically prove more robust, because of the smaller tick size.

Of course, there are many other challenges to high frequency equity trading that futures do not suffer from, such as the multiplicity of trading destinations.  This means that, for instance, in a consolidated market data feed your system is likely to see trading opportunities that simply won’t arise in practice due to latency effects in the feed.  So the profitability of HFT equity strategies is often overstated, when measured using a consolidated feed.  Futures, which are traded on a single exchange, don’t suffer from such difficulties.  And there are a host of other differences in the microstructure of futures vs equity markets that the analyst must take account of.  But, all that understood, in general I would counsel that equities make an easier starting point for HFT system development, compared to futures.