TanHef

Leading Indicator [TH]

TanHef Telah dikemas kini   
The leading indicator is helpful to identify early entries and exits (especially near support and resistance).

Green = trend up
Red = trend down

How it works:
The leading indicator calculates the difference between price and an exponential moving average.
Adding the difference creates a negative lag relative to the original function.
Negative lag is what makes this a leading indicator.
The amount of lead is exactly equal to the amount of lag of the moving average.
The leading indicator has lagging signals at turning points.
The leading indicator will always have noise gain, which gets eliminated by applying a moving average.

Modifying the alpha values will modify the amount of noise and change the sensitivity of trend change.
Example 1: Changing alpha1 from 0.25 to 0.15 lowers noise, more clearly identifies trend, and adds delay to this indicator.
Example 2: Changing alpha1 from 0.25 to 0.35 increases noise, less clearly identifies trend, BUT more quickly indicates a trend change.

Calculations:

Where:
alpha1 = 0.25
alpha2 = 0.33

Leading = 2 * (arithmetical mean of current High and Low price) + (alpha1 - 2) * (arithmetical mean of previous High and Low price) + (1 - alpha1) * (previous 'Leading' value)
Total Leading = alpha2 * leading + (1 - alpha2) * (previous 'Total Leading' value)
EMA = 0.5 * (arithmetical mean of previous High and Low price) + 0.5 * (previous 'EMA' value)

Uptrend when 'Total Leading' value is greator than the EMA
Downtrend when 'Total Leading' value is lesser than the EMA

Cybernetic Analysis for Stocks and Futures, by John Ehlers (page 231-235)
Nota Keluaran:
Added alerts for when trend changes up or down.

How to add alerts:
1. Add the indicator to the chart then, then go into its settings
2. Check off Alerts to enable
3. Create Alert
4. Set condition to "Leading"
5. Select create

www.tanhef.com/

Scripts and content from TanHef are solely for information and education. Past performance does not guarantee of future results.
Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?