John Ehlers Trading Strategy: The Instantaneous Trendline (Backtest)

Discussion in 'Educational Resources' started by TrAndy2022, May 15, 2023.

  1. TrAndy2022

    TrAndy2022

    https://www.quantifiedstrategies.com/john-ehlers-trading-strategy/

    John Ehlers Trading Strategy: The Instantaneous Trendline (Backtest)

    Last Updated on May 15, 2023

    Today we want to delve into John Ehler’s Trading Strategy and an indicator created by this famous author to investigate financial instruments quantitatively.

    In August 2006, John Ehlers published an article in Stocks & Commodities titled Modeling The Market = Building Trading Strategies writing about the Instantaneous Trendline. We want to backtest and see how one trading system suggested in the article would have performed on nearly 17 years of out-of-sample data.

    Finally, we will propose using the Instantaneous Trendline indicator created by John Ehlers.

    However, if you want hundreds of other short term trading strategies, please check out other articles.

    Table of contents:
    Who is John Ehlers?
    In the trading community, John Ehlers is well-known name. He is a prolific author of quantifiable indicators to analyze financial price series data.

    Ehlers is an electrical engineer specializing in Fields, Waves, and Information Theory who became a private trader in 1976. He became famous for developing and publishing indicators based on the application of concepts from his field of studies to the financial markets.

    Backtesting the works of John Ehlers
    While John Ehlers has written many books and articles on his indicators, we do not find these texts supplemented with corresponding backtests and equity lines.

    So we decided to take one of his published articles and backtest the trading system he suggested after many years after its publication. The article we are referring to is the one that appeared in January 2006 in Stocks & Commodities.

    What is the Instantaneous Trendline?
    The basic idea is that a price series comprises a trendline and a cyclical curve. The aim is then to decompose the price data series to get a clear direction by looking at the trend component and to get reversal points by looking at the cyclical component. The math behind these analyses isn’t simple, so let’s skip it.

    Let’s illustrate the main idea in a simplified way:

    The primary step is to filter the cyclical component of the dominant cycle by applying a simple moving average over its period. Doing this removes frequencies equal to and greater than the dominant one.

    What remains after filtering is the Instantaneous Trendline. The real implementation is more complex and with additional hints. But still, the main parameter is the period of the dominant cycle.
    John Ehlers writes that the value of this parameter varies over time, but since taking this into account is complex, he suggests using a constant value. For the daily data series of ES-mini futures, Ehlers indicates to use a value of 15 periods.

    Backtesting John Ehlers Instantaneous Trendline
    Ehlers suggests that we can get a trend following trading system if we go long when the Instantaneous Trendline crosses a repeat of itself, lagging a bar or two, and go short when the Instantaneous Trendline crosses below it.

    Ehlers also points to other trading system ideas. But he does not provide any backtests, performance statistics, or equity lines for the suggested trading systems.

    So now let’s backtest the trend follower trading system by applying it to both the back-adjusted ES-mini futures contract and SPY using daily bars. The results should be reasonably similar for both the futures contract and the ETF, given that the futures contract uses the same open and close time. We use a parameter of 15 for the dominant cycle length for both.

    The trading rules for John Ehlers trading strategy
    We use the following trading rules to backtest the trading strategy (if you want the code for the strategy, it’s included in our Silver membership):

    Buy = Cover = Cross(ITrend, Ref(ITrend, -1));

    Sell = Short = Cross(Ref(ITrend, -1), ITrend);

    This is the equity line going for long positions with one future contract for the ES-mini starting with a capital of 1.000.000:

    [​IMG]
    This is the equity line when going short trading one future contract for the ES-mini starting with a capital of 1.000.000:

    [​IMG]

    This is the equity line going long trading the SPY ETF, starting with a capital of $100.000 and compounding the capital.

    [​IMG]
    This is the equity line going short trading the SPY ETF starting with a capital of $100.000 and compounding the capital.

    [​IMG]
    As you can see, the performance is very poor in every case, if not downright disastrous. What is most astonishing is that the performance is awful not only in the out-of-sample data but also in the in-sample data.

    How to exploit the John Ehlers Instantaneous Trendline – we made a sound strategy
    However, the last equity line suggests that the strategy can be used by reversing the direction of trades from short to long, thus obtaining a decent increasing equity curve. Looking for a strategy in one direction and finding a valid one in the opposite direction often happens to those looking for trading strategies.
    The important thing is to know how to observe and discern the results obtained. The most significant scientific discoveries have been made when getting totally unexpected results.

    We then decided to go long the SPY ETF when the Instantaneous Trendline crosses its one-period lagged value to the downside and apply a price action-based exit criterion we often use. After an optimization process, we fix the parameter that defines the dominant cycle length equal to 2.

    In doing so, the trading system is no longer a trend-following strategy but becomes a mean reversion trading system that exploits the bullish bias of the SPY.

    The results are excellent and are illustrated below:

    [​IMG]
    The trading statistics and metrics for the strategy (without dividends and commission fees ) for John Ehlers trading strategy are:

    • 1009 trades since 1993
    • Annual Return: 10.56% (buy and hold is 7.72%) – not including dividends
    • The average gain per trade is 0.32%
    • 65.71% of the trades are winners
    • You are invested 45.51% of the time
    • Max drawdown is 23.96% (buy and hold 56.47%)
    • Risk-adjusted return is 23.21% (10.56% divided by 0. 4551) (buy and hold 7.72%)
    Here is the Underwater Equity showing the trend of the drawdowns:

    [​IMG]

    It is evident that it is a sound trading system that manages to beat the buy & hold strategy by a wide margin.

    John Ehlers trading strategy and system – conclusion
    We believe that concrete results and feedback must always accompany the proposition of quantifiable trading strategies. This is why we wrote this article about John Ehler’s trading strategy without finding much useful info one the original strategy proposed by John Ehlers in 2006. In any case, we exploited his Instantaneous Trendline indicator, adapting it to the market.
     
    beginner66 and murray t turtle like this.
  2. %%
    Good points;
    I never really did believe John Ehler's over complex Title / Rocket Science for Traders\
    even if he was most likely playing off the popular expression ''its not rocket science'':D:D
    HE maybe also right by a long shot, even though some publishers pay by the Word or page; = he gives a lot more pages on EMA than SMA[simple ma]LOL
    Actually an EMA would maybe better on a rocket type trend, hindsight + foresight but some weight something more simple also.............................
     
  3. panzerman

    panzerman

    Read his latest interview in S&C.

    https://www.mesasoftware.com/TechnicalArticles.htm

    He dismisses cycle measurement for market data. Look into his Zero Lag and Optimal Tracking Filter if you are looking for a trend indicator. If you like cyclical indicators, have a look at the "A Peek into the Future" article.
     
    ph1l, beginner66 and TrAndy2022 like this.
  4. ph1l

    ph1l

    http://technical.traders.com/free/V41C04598INTE.pdf
    That's interesting because it contradicts many of the things he has written over the years like in
    https://bettersystemtrader.com/107-indicators-that-adapt-to-changing-market-conditions/
    upload_2023-5-15_16-11-37.png

    I kind of agree with his more recent assessment of cycles. Different measurement methods can have very different values, and the amplitudes, periods, and phases of found cycles can change quickly. But that doesn't keep me from playing around with them.
     
    TrAndy2022 likes this.