OPEN-SOURCE SCRIPT
MA Derivatives (Normalized)

This indicator measures how the rate of change of a moving average is itself changing — velocity, acceleration, and jerk — all normalized to a common scale so they're comparable regardless of price level.
The derivative chain
The MA is computed first (your choice of SMA, EMA, HMA, or linear regression). Then three successive differences are taken:
D1 = MA minus MA[1] — velocity. Is the MA rising or falling, and how fast?
D2 = D1 minus D1[1] — acceleration. Is the velocity increasing or decreasing?
D3 = D2 minus D2[1] — jerk. Is the acceleration itself speeding up or slowing down?
Each step is just a first difference of the prior series. Simple arithmetic, but the information content compounds — D3 is the third difference of price, which is extremely sensitive to inflection.
Normalization
Raw derivatives are price-denominated and incomparable across instruments or time. The normalize() function solves this by finding the maximum absolute value of each derivative over the lookback window and dividing through, which maps everything to [-1, +1] while preserving sign and centering on zero. A reading of +0.8 on D2 means acceleration is near the top of its recent range — not that it equals 0.8 dollars or points.
What each derivative tells you in practice
D1 crossing zero is the standard MA direction flip — trend turning up or down. Nothing novel there.
D2 is the actionable layer. Positive D2 inside a downtrend means deceleration — the MA is still falling but losing momentum. This is the classic early warning. The histogram columns are green when D2 is positive, red when negative, which makes divergences between D1 direction and D2 direction visually immediate.
D3 is the most leading but noisiest signal. A D3 flip from negative to positive while D2 is still negative means the deceleration is itself accelerating — the curve is bending back faster. In practice it's most useful as a confirmation layer rather than a standalone signal.
The grid
The 21 hlines from -1.0 to +1.0 in 0.1 increments give the pane a structured reading frame. The ±0.5 dashed lines act as informal overbought/oversold analogs — a D2 sustained above +0.5 means acceleration is running hot relative to recent history.
The practical read
The highest-conviction setup is when D1 is still negative (trend down) but D2 has crossed above zero and is climbing toward +0.5 or higher. That combination — trend still bearish, acceleration turning bullish — precedes many meaningful reversals. Add D3 confirming positive and you have all three derivatives aligned on the turn before price has confirmed it.
The HMA option as the MA base sharpens all three derivatives because HMA's reduced lag means its slope changes faster and more cleanly at inflection points than SMA or EMA would.
The derivative chain
The MA is computed first (your choice of SMA, EMA, HMA, or linear regression). Then three successive differences are taken:
D1 = MA minus MA[1] — velocity. Is the MA rising or falling, and how fast?
D2 = D1 minus D1[1] — acceleration. Is the velocity increasing or decreasing?
D3 = D2 minus D2[1] — jerk. Is the acceleration itself speeding up or slowing down?
Each step is just a first difference of the prior series. Simple arithmetic, but the information content compounds — D3 is the third difference of price, which is extremely sensitive to inflection.
Normalization
Raw derivatives are price-denominated and incomparable across instruments or time. The normalize() function solves this by finding the maximum absolute value of each derivative over the lookback window and dividing through, which maps everything to [-1, +1] while preserving sign and centering on zero. A reading of +0.8 on D2 means acceleration is near the top of its recent range — not that it equals 0.8 dollars or points.
What each derivative tells you in practice
D1 crossing zero is the standard MA direction flip — trend turning up or down. Nothing novel there.
D2 is the actionable layer. Positive D2 inside a downtrend means deceleration — the MA is still falling but losing momentum. This is the classic early warning. The histogram columns are green when D2 is positive, red when negative, which makes divergences between D1 direction and D2 direction visually immediate.
D3 is the most leading but noisiest signal. A D3 flip from negative to positive while D2 is still negative means the deceleration is itself accelerating — the curve is bending back faster. In practice it's most useful as a confirmation layer rather than a standalone signal.
The grid
The 21 hlines from -1.0 to +1.0 in 0.1 increments give the pane a structured reading frame. The ±0.5 dashed lines act as informal overbought/oversold analogs — a D2 sustained above +0.5 means acceleration is running hot relative to recent history.
The practical read
The highest-conviction setup is when D1 is still negative (trend down) but D2 has crossed above zero and is climbing toward +0.5 or higher. That combination — trend still bearish, acceleration turning bullish — precedes many meaningful reversals. Add D3 confirming positive and you have all three derivatives aligned on the turn before price has confirmed it.
The HMA option as the MA base sharpens all three derivatives because HMA's reduced lag means its slope changes faster and more cleanly at inflection points than SMA or EMA would.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。