Free TradingView indicator

Leading Indicator.

How its trend reading, calculation, sensitivity, and optional alerts work.

Source: TanHef's TradingView publication · Page reviewed

Overview

A trend reading designed to respond early.

Leading Indicator is a public, open-source TradingView script based on a leading-filter method described by John Ehlers. It compares a smoothed leading calculation with an exponential moving average (EMA) reference to indicate whether its calculated trend is up or down.

The calculation is designed to reduce some of the delay introduced by smoothing, but its name does not mean it predicts the next price move. A change in its reading may be worth reviewing near support or resistance, where price context is especially important.

What the colours mean

Green for up, red for down.

Green means the smoothed leading value is above the EMA reference. Red means it is below. A change of colour marks a change in that relationship; it is not, by itself, a confirmed entry or exit.

Read the colour alongside the chart's price structure and your own risk controls. A fast or choppy market can cause the reading to change more than once before a lasting price trend develops.

Method

How the leading calculation works.

This summary follows the calculation described in the TradingView publication:

  1. Start with the midpoint of each bar's high and low prices.
  2. Combine the current midpoint, the previous midpoint, and the prior leading value. The documented example uses an alpha 1 value of 0.25 for this stage.
  3. Smooth that leading value into a Total Leading value using alpha 2, shown as 0.33 in the documented example.
  4. Compare Total Leading with an EMA reference. The documented EMA calculation uses a 0.5 weighting. The comparison determines the up/down colour.

The leading step aims to offset part of the lag of an average. It can also amplify short-term noise, which is why a second smoothing step is used. The TradingView publication provides the exact formulas and open-source script.

The method is credited in that publication to John Ehlers, Cybernetic Analysis for Stocks and Futures, pages 231–235.

Settings

Sensitivity trades speed for noise.

For example, reducing alpha 1 from 0.25 to 0.15 smooths more noise, but can delay a change in the reading. Raising it from 0.25 to 0.35 makes the reading react sooner, but can also make it noisier. Alpha 2 provides the second smoothing stage.

There is no setting that makes every trend change both early and reliable. If you adjust sensitivity, compare the result across different market conditions rather than judging it from one favourable example.

Chart options

Alerts and chart colours.

You can set an alert when the indicator changes between an uptrend and a downtrend. You can also colour price bars to show the current reading.

Intended use

A reading to investigate, not a prediction.

Even a leading calculation can lag at turning points, and greater responsiveness can produce false or short-lived changes. The indicator does not confirm that support or resistance will hold, predict a reversal, or guarantee a profitable trade.

Open Leading Indicator on TradingView