OPEN-SOURCE SCRIPT

Trading the Trend

Trading the Trend Indicator by Andrew Abraham (TASC, 1998)

The Trading the Trend indicator, developed by Andrew Abraham, combines volatility and trend-following principles to identify market direction. It uses a 21-period weighted average of the True Range (ATR) to measure volatility and define uptrends and downtrends.

Calculation: The True Range (highest high minus lowest low) is smoothed using a 21-period weighted moving average. This forms the basis for the trend filter, setting dynamic thresholds for trend identification.
Uptrend: Higher highs are confirmed when price stays above the upper threshold, signaling long opportunities.
Downtrend: Lower lows are identified when price stays below the lower threshold, favoring short positions.
This system emphasizes trading only in the direction of the prevailing trend, filtering out market noise and focusing on sustained price movements.

The trendline changes her color. When there is an uptrend the trendline is blue and when the trend is downward the trendline is yellow.
Trend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer