The ERTrend strategy is based on the trend-following indicator Efficiency Ratio (ER). Values of this indicator are interpreted by the strategy as follows:

  • ER values being greater than both a lower threshold (crit level in the input parameters) and its own lowest value times a multiplier are read as indication of trend development;
  • ER values being greater than a higher threshold level (trend level in the input parameters) but lower than the maximum level are interpreted as strong trending conditions;

If either of these conditions is true and close price rises above its own moving average, a simulated buy-to-open order is added. In the same conditions, a simulated sell-to-open order is added should the close price fall below the average.

Simulated exit orders are added based on crossovers of the close price plot with its moving average: when the close price crosses below the average, a simulated sell-to-close order is added; when it crosses above - the simulation of buy-to-close takes place.  

Input Parameters


Defines the period for the calculation of the Efficiency Ratio (ER).

er average length The number of bars used to calculate the ER average.
lag Defines the period upon which the lowest ER value is to be found (used in checking for trend development).
average length Defines the period for the calculation of the close price moving average.
trend level

Defines the minimum ER level at which strong trending conditions are recognized.

max level

Defines the maximum ER level at which strong trending conditions are recognized.

crit level

Defines the minimum ER level at which trend development is recognized.

mult Defines the multiplier used in checking for trend development.
average type

The type of moving average to be used in calculations: simple, exponential, weighted, Wilder's, or Hull.

Further Reading

 1. "Which Trend Indicator Wins?" by Markos Katsanos. Technical Analysis of Stocks & Commodities, October 2016.

Backtesting is the evaluation of a particular trading strategy using historical data. Results presented are hypothetical, and there is no guarantee that the same strategy implemented today would produce similar results.

Technical analysis is not recommended as a sole means of investment research.

For educational purposes only. Not a recommendation of a specific security or investment strategy.

You may also like
The Momentum Percent Diff is a momentum-based technical indicator. Unlike the regular Momentum ...
The Intraday Momentum Index (IMI) is a variation of Relative Momentum Index which takes into ...
The Stoller Average Range Channel (STARC) Bands are two bands plotted around a short-term simple ...