• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Decoding Markets

  • Access All Areas
  • Courses
  • Free Book
  • Resources
    • Best Books
  • Blog
    • About
    • Free Class
    • Top Posts
You are here: Home / Stocks / Improving Trend Following With The PE Ratio

August 22, 2019 By Joe Marwood 2 Comments

Improving Trend Following With The PE Ratio

In a previous article we looked at the effects of introducing price to earnings data to a mean reversion strategy. 

Although the effects were quite small, we found that we could improve a simple RSI strategy by avoiding stocks with negative PE ratios. 

We also found that stocks with PE ratios over 15 produced higher win rates and higher Sharpe ratios. 

In this article we will conduct a similar analysis but this time our focus will be on trend following strategies. 

Baseline Trend Following Strategy

To analyse the effect of price to earnings data we will start with a baseline trend following strategy that buys large cap stocks from the S&P 100. 

We will then compare the results of adding rules based on price to earnings data. 

The full rules of the baseline strategy can be described as follows:

  • Buy = New 200-Day High (Close)
  • Sell = 10% Trailing Stop
  • Timeframe = Daily
  • Universe = S&P 100 (dividend adjusted and including delisted symbols*)
  • Starting Capital = $100,000
  • Portfolio Size = 10
  • Position Size = 10% (equal weight/no margin)
  • Ranking = ROC(200) highest preferred
  • Commissions = $0.01 per share
  • Execution = All trades placed on next bar open
  • Test Period = 1/2007 – 1/2019

This is a very simple trend strategy that buys new 200-day highs but it is shown to be profitable with an annualised return of roughly 7% and a Sharpe ratio of 0.18:

  • # Trades: 298
  • CAR: 6.97
  • RAR: 8.33
  • WR: 46.98
  • MDD: -22.95
  • CAR/MDD: 0.3
  • Sharpe: 0.18
The base trend following strategy produced a CAR of 6.97% with a maximum drawdown of -22.95%. Buy and hold SPY produced a CAR of 7.03% with a maximum drawdown of -55.19%.

This return may not seem like much, however, it is ahead of buy and hold on a risk-adjusted basis and as we saw in our Jesse Livermore tutorial, the return can be greatly enhanced with some simple pyramiding.

*See notes about data below.

Trade Example

Next is a trade example in LLY:

LLY hit a profitable trend in 2014.

You can see that LLY hits a new 200-day high on the 18th February 2014. We therefore go long on the next open with a 10% position size.

The stock keeps moving higher until we are taken out by a 10% trailing stop on the 9th August 2015. The total profit after commissions is 50.03%.

Adding P/E and EV/EBITDA Rules

Now we have seen the results of this baseline strategy we can start adding some fundamental rules to this system and see if they have any positive effect. 

For this analysis we are going to run six additional tests as follows: 

  • Test 1: Baseline rules AND P/E Ratio > 0
  • Test 2: Baseline rules AND P/E Ratio > 15
  • Test 3: Baseline rules AND P/E Ratio > 0 AND < 15
  • Test 4: Baseline rules AND EV/EBITDA > 0
  • Test 5: Baseline rules AND EV/EBITDA > 15
  • Test 6: Baseline rules AND EV/EBITDA > 0 AND < 15

As you can see, we are testing the inclusion of two valuation ratios: the P/E ratio and the EV/EBITDA ratio. 

For example, let’s say we are running test five and we get a new 200-day high in AAPL. Well, we will only take that signal if the EV/EBITDA ratio is also over 15.

EV/EBITDA is often seen as a more sophisticated version of P/E. I also prefer it to P/E so it should be interesting to see our results.

A Note About The Data

For this analysis we will be using Amibroker with end of day price data from Norgate and fundamental earnings data from Intrinio. This data is pulled into Amibroker using an API script.

The data includes delisted stocks, however, there are approximately 16 symbols (out of 224) of which I was unable to source complete fundamental data for. Symbols such as BUD (Anheuser Busch), LEHMQ (Lehman Brothers) and WB (Wachovia) have therefore been left out of this analysis. 

I suspect the difference from including these symbols would be minimal but it’s worth remembering that there could be some bias in the results.

Fundamental data does tend to have inaccuracies so results should be treated with some caution anyway.

BackTest Results

The following table shows the results of introducing earnings rules to our baseline trend following strategy with the baseline strategy shown first:

The best risk-adjusted return, win rate and Sharpe came with a PE above zero and below 15.

As you can see from the table above, we got some subtle but quite interesting results. 

The baseline strategy produced the highest CAR (6.97%) but it also produced the largest drawdown (-22.95%). 

Test three (P/E ratio between 0 and 15) produced the best risk adjusted return (9.71%), win rate (49.76%) and Sharpe (0.22). It also produced the smallest drawdown (-11.20%).

Test five (EV/EBITDA > 15) produced the worst return (2.58%), win rate (40.8%) and Sharpe (0.05).

Note: stocks with a zero P/E are stocks with negative earnings.

Best Result Equity Curve

Following is the equity curve for our best risk-adjusted result, test three:

Equity curve for test three which filters out stocks with negative PE or PE above 15.

You can see that the equity curve is fairly smooth, sloping upwards and to the right.

Some Initial Observations

This is by no means a definitive test but I think we can make some crude observations about the results we have seen so far. 

First, it appears that breakout trades work better when combined with a cheaper valuation. 

The best RAR and drawdown were both recorded when filtering out negative PE stocks or PE more than 15.

This finding is somewhat encouraging because it makes logical sense. 

If you’re buying a stock at a new high it makes sense to buy one with a cheaper valuation rather than a higher valuation as you would think a high valuation would be more likely to pull back and a cheaper stock might have more room to run.

Second, the worst result came from an EV/EBITDA valuation over 15. Again, this makes some sense for the same reason as mentioned above. 

There does seem to be some difference between using EV/EBITDA and P/E, however, which may be something that needs to be looked at more closely. 

What is also interesting is that this result is essentially the opposite of what was shown in our mean reversion analysis. 

That analysis showed that higher P/E stocks were better candidates for mean reversion trades. But we have found that lower P/E stocks are better for breakout trades.

In fact, filtering out stocks with a P/E over 15 seems to improve results quite nicely as we have got to a CAR/MDD ratio of 0.58.

Conclusions

Conducting this analysis with fundamental data has not been easy due to certain limitations present with the data.

It would be nice to run this test on a larger database like the S&P 500 and over a longer time period such as back to 2000 or 1990. 

However, I suspect such a test would contain too many missing symbols and too many inaccuracies to make it worthwhile. 

We seem to take data for granted now but it’s worth remembering that twenty years ago recording millions of data points would have been a huge undertaking. 

Therefore it’s not surprising that fundamental data is patchy and should always be treated with caution. 

However, I think we produced a couple of interesting insights.

First, stocks with negative earnings perform poorly whether we are trading mean reversion or trend following. 

Second, low P/E appears better for trend following and high P/E appears better for mean reversion.

Charts and analysis produced with Amibroker with historical data from Norgate and fundamental data from Intrinio.


Thank You For Reading

joe marwood profile pictureJoe Marwood is an independent trader and the founder of Decoding Markets. He worked as a professional futures trader and has a passion for investing and building mechanical trading strategies. If you are interested in more quantitative trading strategies, investing ideas and tutorials make sure to check out our program Marwood Research.


Disclaimer

This post expresses the opinions of the writer and is for information or entertainment purposes only. It is not a recommendation or personalised investment advice. Joe Marwood is not a registered financial advisor or certified analyst. The reader agrees to assume all risk resulting from the application of any of the information provided. Past performance, historical or simulated results  are not a reliable indicator of future returns and may not account for real world settings. Financial trading is full of risk and margin trading can lead to financial losses totalling more than what is in your investment account. We take care to present accurate analysis but mistakes in backtesting and presenting of analysis regularly occur. Please read the Full disclaimer.


Comment Policy

Thank you to everyone who takes the time to leave a comment. Your feedback, constructive criticism and identification of mistakes is welcome. In order to concentrate on work I may not have time to respond to all comments.

Filed Under: Stocks, Strategies/ Systems, Trend Following Tagged With: stocks, trading systems

Recommended Educational Resources:


  • Discover New Trading Strategies
  • Learn Japanese Candlesticks (Free)
  • Mental Models For Trading (Free)
  • Indicators For Amibroker (Free)
  • Tools For Options Traders (Free)
  • Historical Data For 8000 Stocks (Free)

Reader Interactions

Comments

  1. Jonatan Tågerud says

    August 23, 2019 at 2:39 am

    Interesting study. Like that it’s backed by logic as well.
    I’m working with Amibroker and to my knowledge P/E and other fundamentals are scalar, e.g can only store one point of data. How do you manage to store the historical data in Amibroker?

    Reply
    • Joe Marwood says

      August 23, 2019 at 8:57 am

      The data isn’t stored in Amibroker as such it is accessed real time using an API script to pull the data in from Intrinio. Thanks.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Decoding Markets

We build trading strategies that give you more profit with less stress.

joe marwood beach

Popular

The Truth About Intraday Momentum

Slide 1 Trading Desk

How To Build A Mean Reversion Trading Strategy Ultimate Guide

13 Reasons You Should Learn The Amibroker Custom Backtest

Testing Turnaround Tuesday On The US Stock Market

best moving average test on s&p 500

Which Is The Best Moving Average? Test Results Reveal The Truth

Testing A Reader’s RSI Trading Strategy

Financial Disclaimer

Financial trading is risky and short-term trading is hard. You can lose money. Joe Marwood is not a registered investment advisor and nothing on this site is to be regarded as personalized investment advice. Past performance is not indicative of future results. Data errors and mistakes do occur. Please see the full disclaimer.

Footer

About The Author

Joe Marwood is an independent trader and investor specialising in financial market analysis and trading systems. He worked as a professional futures trader for a trading firm in London and has a passion for building mechanical trading strategies. He has been in the market since 2008 and working with Amibroker since 2011.

Joe Marwood Profile PIc

Recent Posts

  • Contagion In Crypto
  • Can You Predict Cryptocurrencies?
  • Do Sell-Side Analysts Know Better?
  • Using Fundamental Data To Improve Momentum Investing Strategies
  • 5 Economic Indicators That Matter To Investors
  • How To Make Money In REITs
  • Follow The Leader To Make Money In Stocks
  • Can You Make Money From Short Seller Reports?

Categories

Search

Topics

  • Amibroker
  • Investing Books
  • Mean Reversion
  • Stock Trading Strategies
  • Technical Analysis
  • Trend Following
  • Quant Trading

Privacy policy | Contact | Disclaimer | All Rights reserved. Decoding Markets.