PROTECTED SOURCE SCRIPT
Momentum Phases

📌 Overview
The Momentum Phases indicator helps traders quickly identify periods of strong bullish or bearish momentum based on the relationship between a short‑term and a long‑term Moving Average (SMA).
It helps traders visually distinguish between Positive 🟢, Negative 🔴, and Neutral ⚪ phases by plotting a dynamically colored state line and generating optional alerts when a phase change occurs.
🧠 How It Works
⦿ SMA Calculation
Pine Script®
⦿ Momentum Ratio
Pine Script®
⦿ Threshold Levels
⦿ Momentum States
⦿ State Line Plot
📈 How to Use
⚙️ Customization
🔔 Alerts
🎯 Add this indicator to your chart to track momentum phases like a pro — know exactly when trends start, end, or stall.
The Momentum Phases indicator helps traders quickly identify periods of strong bullish or bearish momentum based on the relationship between a short‑term and a long‑term Moving Average (SMA).
It helps traders visually distinguish between Positive 🟢, Negative 🔴, and Neutral ⚪ phases by plotting a dynamically colored state line and generating optional alerts when a phase change occurs.
🧠 How It Works
⦿ SMA Calculation
- The indicator calculates two SMAs:
- Short SMA (default: 7 periods)
- Long SMA (default: 65 periods)
- Both SMA lengths can be adjusted by the user.
// SMA calculations
smaShort = ta.sma(close, shortLen)
smaLong = ta.sma(close, longLen)
⦿ Momentum Ratio
- A ratio is calculated:
ratio = smaShort / smaLong
- This ratio measures how far the short‑term trend has diverged from the long‑term trend.
⦿ Threshold Levels
- Positive Threshold (default: 1.05) — indicates short SMA is at least 5% above the long SMA.
- Negative Threshold (default: 0.95) — indicates short SMA is at least 5% below the long SMA.
- These thresholds are user‑adjustable.
⦿ Momentum States
- Positive Momentum: Ratio ≥ Positive Threshold (default: 1.05) → Short SMA is at least 5% above Long SMA.
- Negative Momentum: Ratio ≤ Negative Threshold (default: 0.95) → Short SMA is at least 5% below Long SMA.
- Neutral: Ratio between the two thresholds.
⦿ State Line Plot
- The indicator plots a flat state line at 1.0 when in positive or negative momentum, and 0.0 when in neutral.
- The state line’s color changes dynamically:
- Green 🟢 Positive Momentum: Ratio ≥ Positive Threshold (default: 1.05) – Short SMA is at least 5% above Long SMA.
- Red 🔴 Negative Momentum: Ratio ≤ Negative Threshold (default: 0.95) – Short SMA is at least 5% below Long SMA.
- Gray ⚪ Neutral: Ratio between the two thresholds.
📈 How to Use
- Trend Confirmation: Use the state line color to quickly confirm the prevailing momentum.
- Green 🟢: Consider focusing on long setups
- Red 🔴: Consider focusing on short setups
- Gray ⚪: Consider staying neutral or waiting for stronger signals
- Trade Filtering: Filter trades in your existing strategy so they only align with the detected momentum phase.
- Early Warnings: Enable phase change alerts to get notified when market conditions shift.
⚙️ Customization
- SMA Periods: Adjust short and long SMA lengths to suit your trading timeframe.
- Thresholds: Tighten (closer to 1.00) for more frequent signals, or widen for fewer but stronger signals.
🔔 Alerts
- 🟢 Positive Momentum START – Stock/Security shifts into positive momentum.
- ⚪ Positive Momentum END – Positive momentum ends (neutral state).
- 🔴 Negative Momentum START – Market shifts into negative momentum.
- ⚪ Negative Momentum END – Negative momentum ends (neutral state).
- Momentum Phase Change – Any shift between Positive, Negative, or Neutral.
🎯 Add this indicator to your chart to track momentum phases like a pro — know exactly when trends start, end, or stall.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 제한 없이 자유롭게 사용할 수 있습니다 — 여기에서 자세히 알아보기.
Naved Iqbal
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
보호된 스크립트입니다
이 스크립트는 비공개 소스로 게시됩니다. 하지만 제한 없이 자유롭게 사용할 수 있습니다 — 여기에서 자세히 알아보기.
Naved Iqbal
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.