Skip to content
All library documents

Trend Entries and Trailing-Stop Exits with Moving Averages

Article ProRealCode

Summary

The TN Alerts indicator describes a trend-following approach using fast and slow weighted moving averages. A long setup requires a rising slow average and consecutive closes above the fast average; a short setup mirrors those conditions. It can display initial entries, optional same-direction re-entry markers, position status, and trailing-stop levels on a chart. The example supplies default settings, including a fast period of 4, a slow period of 62, and a trailing-stop percentage of 20.

Exits are inferred from changes in the stored trailing-stop boundaries, with separate state variables tracking long and short positions. The document explains the chart markers and offers configurable display options, but provides no backtest, market-specific evaluation, or evidence that the defaults are effective. It recommends testing across market conditions. The rules are presented as an alert indicator and do not establish a complete execution or position-sizing framework.

Key ideas

  • The method uses fast and slow moving averages to define directional entry conditions.
  • Long and short setups require the slow average to slope in the trade direction and price to confirm beyond the fast average.
  • A percentage-based trailing mechanism defines exits and can be displayed on the chart.
  • Optional markers show re-entries, entries, exits, and the current directional state.
  • The document gives example defaults but provides no measured performance results.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.