This week I calculated the e-ratio outlined by Dave Bergstrom for a systematic trading strategy I am currently developing for the FX markets.

**‘BetterSystemTrader’, Dave Bergstrom & the e-ratio**

In the last couple of weeks I have started listening to podcasts from BetterSystemTrader, all of which are available for free. I was pointed to several specific podcasts from colleagues M and B at the hedge fund that i worked next to for most of this year (see “Nine months next to a hedge fund” for my reflections on that phase).

One of the podcasts that came highly recommend was the one by Dave Bergstrom, who runs buildalpha. One of the concepts that Dave discusses in the podcast is the ‘e-ratio’, where ‘e’ is short for ‘edge’. Dave also explains this concept very clearly in a written article, which should make it easier to follow and understand.

Towards the end of this week, I was able to apply the concept of the e-ratio to a systematic trading strategy that I am currently developing. My assumption is that the e-ratio can be calculated very quickly if using Bergstrom’s buildalpha tool, however since I have not purchased a license for it (yet!), I went about calculating it manually.

**Determining the e-ratio**

The e-ratio effectively compares maximum favorable movement (MFE) to maximum adverse movement (MAE) following a trade entry. If a strategy has edge, then, on average, it should predict price movement correctly more often that not. This oversimplifies things but suffices for the discussion here. Essentially one is looking for a ratio greater than 1.

Using code in the TradeStation platform, I tracked the trading strategy’s entry signals over a 5-year period for 30 different FX instruments, using the 4-hour timeframe for identifying setups, and then tracked price behavior for the bars following the entry signal. In total there were 2,200 trading signals. For the purpose of this exercise I set the strategy to enter when the signal is generated and to only close the trade at the end of Friday’s session (my “end of week exit”) – hence no stops or targets. This way I could track the MFE and MAE at any time N bars after entry.

Trades entered on Monday morning would be open for 5 days (or 20 4-hour bars), trades entered on Friday morning would could only be open for a few hours. Hence all entries would have a MFE/MAE zero bars after entry, but only trades opened on a Monday would be open for 20 bars. Hence the number of trades open after N bars decreased as N increases (as per the table below).

I then added together the MFE and MAE values for all the trades at each ‘N bar’ category. Following Bergstrom’s advice, I ‘normalized’ the MFE & MAE values so that a consolidation across different instruments would be meaningful. I did this by dividing the MFE & MAE values by the average true range of the relevant instrument at the time that the signal was generated.

In order to get the average MFE/MAE, it was just necessary to divide the sum values by the count values. To get the e-ratio for each N value, one then simply divides the average MFE by the average MAE, as follows:

Now all the e-ratio values can be plotted on a line graph. I have excluded the N values in excess of 20, as the sample size falls to below 400 at that point. The graph looks as follows:

Note that, in his article, Bergstrom also adds a second line to the chart – which is a line generated by the buildalpha application using the historical price data for the relevant instrument(s) and the best randomly generated entry signals.

**Insights & Questions**

If I am understanding Bergstrom correctly, then my figures indicate that this trading strategy in its current shape and form does not have edge because the ratio is always less than 1. I also assume that a monkey throwing darts for choosing stocks to buy and sell should, on average, achieve an e-ratio of 1.

Interestingly the value steadily increases as more time has passed since the entry signal. Does this mean that the signal actually has bad predictive power right at the time of entry? As time passes the price movements go back to randomness, hence approaching 1 as time progresses? Does this mean the optimal action would be to the do opposite of what the trading signal implies and then close the trade 4-5 bars after entry?

I don’t know the answers to these questions for now & but in any case thought I share what I have done in this area.

**BetterSystemTrader and Bergstrom on Twitter**

Incidentally, the BetterSystemTrader site seems to be an excellent resource for traders in the systematic area. Definitely check it out. You can follow both BetterSystemTrader and Dave Bergstrom on Twitter.

Excellent article! I would only add that IMHO the notion that a strategy has no edge if e equals 1 is incorrect. The ratio does not really tell you anything about the edge fo a trading system. The only situation where it would indicate edge of a trading system is a system with random exits. Such a system would have a negative expectancy if e equals or is less than 1 and postive if greater than 1 (disregarding transaction costs and slippage).

E.g. consider an asset that is priced at 100. The market in question always exhibits two price points post entry, namely 98 and 102, in random order. The e-ratio for a system that enters at 100 is 1. But if you have take profit at 2 and stop loss at 3, the system’s trades will be 100% profitable, the postive expectancy for each trade (long or short) is 2.

What the e-ratio (as I understand it) does say is that in situations where e-ratio exceeds 1, it can be argued that in such a market situation, it should be easier to identify a trading system with a positive expectancy. Also, if the e-ratio of your entries materially exceeds the e-ratio of random entries, then that is an indication that the entry is likely to contribute to creating edge (still says nothing about the exit or the money management).

LikeLiked by 1 person

Pingback: Tips on developing automated trading strategies | Trick or Trade