OPEN-SOURCE SCRIPT

Tandem EMA Trends

This indicator helps to identify trends using 2 (tandem) EMAs: a fast EMA and a slow EMA. Set the lengths of the EMAs in the inputs (fast EMA should be a smaller number than the slow EMA).

The trend is bullish if the current value of the fast EMA > current value of the slow EMA AND the current value of the fast EMA > the prior bar's value of the fast EMA.

The trend is bearish if the current value of the fast EMA < current value of the slow EMA AND the current value of the fast EMA < the prior bar's value of the fast EMA.

The fast EMA is countertrend to the slow EMA if either of the following 2 conditions exist:
The current value of the fast EMA > current value of the slow EMA AND the current value of the fast EMA < the prior bar's value of the fast EMA (bullish countertrend).
-OR-
The current value of the fast EMA < current value of the slow EMA AND the current value of the fast EMA > the prior bar's value of the fast EMA (bearish countertrend).

Use this script to set custom alerts based off of the current trend like sending webhooks when specific conditions exist.

Customize the colors of the plots.
Exponential Moving Average (EMA)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