The Trend Following strategy is a moving average-based trading system. It adds simulated order of all kinds based on price action in relation to its moving average.

The following conditions are used for order simulation (default percentage values may be optimized via input parameters):

  • Long Entry. Added when the close price rises 3% above its moving average.
  • Long Exit. Added when the close price falls 4% below the moving average.
  • Short Entry. Added when the close price falls 3% below the moving average.
  • Short Exit. Added when the close price rises 4% above its movving average.

Note that stop-losses and profit targets can be used for performance enhancement. In this regard, consider adding StopLossLX, StopLossSX, ProfitTargetLX, and ProfitTargetSX strategies.

Input Parameters

length The period to be used in the calculation of the moving average.
average type The type of moving average to be used in calculations: simple, exponential, weighted, Wilder's, or Hull.
entry percent level The percentage value used for entry orders.
exit percent level The percentage used for exit orders.

Further Reading

1. "Does Fully Automated Trading Software Work?" by James Breen. Technical Analysis of Stocks & Commodities, November 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
thinkScript®: Q&A
What is thinkScript®? thinkScript® is a built-in programming language that gives you the ...
Global Settings
You can specify global settings for strategies by pressing the Global strategy settings... ...
The Swing Three strategy is a basic momentum/breakout trading system developed by Donald ...