OPEN-SOURCE SCRIPT
已更新 Momentum Adaptive EMA | RakoQuant

Momentum Adaptive EMA is a trend-following moving average system designed to dynamically adjust its responsiveness based on market momentum.
Instead of using a fixed smoothing speed like a normal EMA, this indicator becomes fast in strong moves and slow in choppy conditions, producing a cleaner adaptive trend structure.
This version also introduces a secondary POT Moving Average for smooth regime confirmation.
Core Idea
This indicator answers one key question:
Is momentum accelerating enough to justify a faster trend response?
By adapting the EMA’s smoothing factor in real time, the indicator avoids the two classic problems of moving averages:
Lag in strong trends
Whipsaws in sideways markets
How It Works
1. Momentum-Based Adaptivity Engine
The indicator measures momentum using a Rate-of-Change style move:
ROC = current price − price N bars ago
That momentum is normalized by volatility:
Momentum Strength = |ROC| ÷ stdev(ROC)
This produces a clean, scale-independent momentum score.
2. Adaptive EMA (Dynamic Alpha)
Instead of a constant EMA alpha, smoothing is adjusted between:
Alpha Min → slow mode (stable markets)
Alpha Max → fast mode (strong trend markets)
Adaptivity is controlled by:
k (Strength Parameter)
High momentum → EMA reacts faster
Low momentum → EMA smooths more
3. POT Moving Average (Weighted Trend Anchor)
A second moving average is calculated using a Power-Weighted POT MA, where the most recent values receive heavier weight:
Stronger emphasis on recent trend shifts
Smooth confirmation without volatility bands
This creates a clean dual-average regime filter:
Adaptive EMA = fast regime line
POT MA = slower structure anchor
Regime Signals
Trend regime is defined by crossovers:
Bullish regime: Adaptive EMA crosses above POT MA
Bearish regime: Adaptive EMA crosses below POT MA
Optional persistence keeps regimes stable instead of flipping constantly.
Visual System
Bull regime → Ice Blue trend state
Bear regime → Navy trend state
Candle painting optionally matches the active regime
The result is a clean institutional trend overlay with adaptive behavior.
Alerts Included
Bull Break Alert → Adaptive EMA crosses ABOVE POT MA
Bear Break Alert → Adaptive EMA crosses BELOW POT MA
Useful for automation or confirmation systems.
How to Use
✅ Trend filter for directional trading
✅ Adaptive MA replacement for classic EMA systems
✅ Works well on higher timeframes (4H / 1D)
✅ Combine with breakouts, momentum triggers, or volume tools for entries
Inputs Summary
Momentum Length → speed of momentum detection
Normalization Length → volatility scaling window
Alpha Min / Alpha Max → slow vs fast response bounds
Adaptivity Strength (k) → aggressiveness of adaptation
POT Length + Power → smoothing of the confirmation MA
Persistent Regime Toggle → stability vs live switching
Candle Paint Toggle → visual regime clarity
Screenshot Placement
📸 Example chart / screenshot: (insert image here)
Tip: show a strong bull trend + one bearish flip so users understand the adaptive behavior.
Instead of using a fixed smoothing speed like a normal EMA, this indicator becomes fast in strong moves and slow in choppy conditions, producing a cleaner adaptive trend structure.
This version also introduces a secondary POT Moving Average for smooth regime confirmation.
Core Idea
This indicator answers one key question:
Is momentum accelerating enough to justify a faster trend response?
By adapting the EMA’s smoothing factor in real time, the indicator avoids the two classic problems of moving averages:
Lag in strong trends
Whipsaws in sideways markets
How It Works
1. Momentum-Based Adaptivity Engine
The indicator measures momentum using a Rate-of-Change style move:
ROC = current price − price N bars ago
That momentum is normalized by volatility:
Momentum Strength = |ROC| ÷ stdev(ROC)
This produces a clean, scale-independent momentum score.
2. Adaptive EMA (Dynamic Alpha)
Instead of a constant EMA alpha, smoothing is adjusted between:
Alpha Min → slow mode (stable markets)
Alpha Max → fast mode (strong trend markets)
Adaptivity is controlled by:
k (Strength Parameter)
High momentum → EMA reacts faster
Low momentum → EMA smooths more
3. POT Moving Average (Weighted Trend Anchor)
A second moving average is calculated using a Power-Weighted POT MA, where the most recent values receive heavier weight:
Stronger emphasis on recent trend shifts
Smooth confirmation without volatility bands
This creates a clean dual-average regime filter:
Adaptive EMA = fast regime line
POT MA = slower structure anchor
Regime Signals
Trend regime is defined by crossovers:
Bullish regime: Adaptive EMA crosses above POT MA
Bearish regime: Adaptive EMA crosses below POT MA
Optional persistence keeps regimes stable instead of flipping constantly.
Visual System
Bull regime → Ice Blue trend state
Bear regime → Navy trend state
Candle painting optionally matches the active regime
The result is a clean institutional trend overlay with adaptive behavior.
Alerts Included
Bull Break Alert → Adaptive EMA crosses ABOVE POT MA
Bear Break Alert → Adaptive EMA crosses BELOW POT MA
Useful for automation or confirmation systems.
How to Use
✅ Trend filter for directional trading
✅ Adaptive MA replacement for classic EMA systems
✅ Works well on higher timeframes (4H / 1D)
✅ Combine with breakouts, momentum triggers, or volume tools for entries
Inputs Summary
Momentum Length → speed of momentum detection
Normalization Length → volatility scaling window
Alpha Min / Alpha Max → slow vs fast response bounds
Adaptivity Strength (k) → aggressiveness of adaptation
POT Length + Power → smoothing of the confirmation MA
Persistent Regime Toggle → stability vs live switching
Candle Paint Toggle → visual regime clarity
Screenshot Placement
📸 Example chart / screenshot: (insert image here)
Tip: show a strong bull trend + one bearish flip so users understand the adaptive behavior.
版本注释
V2开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。