Trend following strategy: rules and how to test them
By Oalgo · Last reviewed
A trend following strategy tries to stay with a move once it has started. It enters when price shows a trend and exits when the trend ends. It does not try to pick the top or the bottom.
What are the rules of a trend following strategy?
#- Entry: a trend condition becomes true, for example a fast average moves above a slow one.
- Exit: the same condition turns false, or price moves back by a set amount.
- Stop: a Stop Loss as a percentage, for a move against you before the trend condition turns false.
The four rule sets below are the ones people use most. Each has its own page with the rules, the test and the weak points.
| Rule set | The trend condition |
|---|---|
| Moving average crossover | A fast average moves above a slow average |
| Supertrend | The close moves above the Supertrend line |
| EMA pullback | The close is above a long EMA, and RSI dips |
| Breakout | The close moves above the highest high of recent candles |
How do you write this strategy in Oalgo?
#In Oalgo you can tell Oalgo AI your trend following rule in your own words, check the rule it builds, and test it. After testing, if you choose, you Go Live with your own Live Strategy on your own Venue Account at a Supported Venue.
For example, you could tell Oalgo AI: "Enter when the 20-period EMA crosses above the 50-period EMA. Exit when it crosses back below. Use a 2% Stop Loss and a 5% exit target." These numbers are examples to change. A Live Strategy needs a stop on each side it can enter, and an exit target is optional. The example names both.
How do you test this strategy honestly?
#- Run a backtest on a trending range and on a sideways range, and compare the two reports. A trend rule has many entries that go nowhere in a sideways market.
- Check the number of trades, the drawdown and the fees in each report.
- Change the settings a little. If the report falls apart, the first result may be fitted to one period.
- Run a forward test on new prices, with simulated funds, before you decide anything.
What can a trend following strategy not tell you?
#A trend rule reacts after the trend has begun, so it never gets the start of a move, and it gives back part of the move before it exits. It cannot tell a trend from a short burst. In a sideways market it enters and exits again and again. Which rule set suits which market is a question only your own tests can answer.
Read next
- What is backtesting?Backtesting runs your rules on past prices to see how they would have behaved. Learn what it shows, what it cannot show, and how to read the report.
- What is forward testing?Forward testing runs your rules on new prices as they arrive, with simulated funds only. Learn how it differs from a backtest and when to use it.