OPEN-SOURCE SCRIPT
Advanced Market Condition & Momentum

The Advanced Market Condition & Momentum indicator is now available in your editor. This tool is designed to provide professional-grade market context, momentum analysis, and liquidity confirmation without the noise of traditional retail indicators.
Core Engines Implemented
Trend Quality Engine (0–100 Score):
Analyzes Candle Overlap (indecision vs. conviction).
Measures Directional Efficiency (net displacement vs. total movement).
Monitors Wick Frequency to detect auction instability.
Visual: Reflected in the dashboard score and candle transparency.
Momentum Decay Engine:
Detects Expansion (high volume/range impulses).
Identifies Decay when range and volume contract immediately following an impulse.
Visual: Highlights the background with a subtle red fade when momentum is exhausting.
Liquidity Sweep Confirmation:
Tracks previous Pivot Highs/Lows (Fractals).
Detects price piercing these levels and closing back inside.
Confirmation Logic: Only marks a sweep if it is followed by displacement (range expansion).
Visual: Triangle markers (▲/▼) below/above candles.
Market Condition Classifier:
Categorizes the environment into Expansion Trend, Chop/Rotation, Neutral, or Extreme Volatility based on ATR relative to historical averages and the Trend Quality score.
Candle Efficiency Engine:
Color-codes bars based on the quality of the move.
Bright Green/Red: High-efficiency directional control.
Blue (Neutral): Absorption (large range but weak close).
Grey: Low-quality chop or indecision.
Best Practices for Use
Trend Quality: Avoid entering new trend-following positions when the score is below 40 (Chop).
Momentum Decay: Use the background highlights as a "caution" sign to tighten stops or take profits on existing runners.
Liquidity Sweeps: A confirmed sweep (triangle) indicates high-probability rejection, especially when the Trend Quality score is neutral or rotating.
Core Engines Implemented
Trend Quality Engine (0–100 Score):
Analyzes Candle Overlap (indecision vs. conviction).
Measures Directional Efficiency (net displacement vs. total movement).
Monitors Wick Frequency to detect auction instability.
Visual: Reflected in the dashboard score and candle transparency.
Momentum Decay Engine:
Detects Expansion (high volume/range impulses).
Identifies Decay when range and volume contract immediately following an impulse.
Visual: Highlights the background with a subtle red fade when momentum is exhausting.
Liquidity Sweep Confirmation:
Tracks previous Pivot Highs/Lows (Fractals).
Detects price piercing these levels and closing back inside.
Confirmation Logic: Only marks a sweep if it is followed by displacement (range expansion).
Visual: Triangle markers (▲/▼) below/above candles.
Market Condition Classifier:
Categorizes the environment into Expansion Trend, Chop/Rotation, Neutral, or Extreme Volatility based on ATR relative to historical averages and the Trend Quality score.
Candle Efficiency Engine:
Color-codes bars based on the quality of the move.
Bright Green/Red: High-efficiency directional control.
Blue (Neutral): Absorption (large range but weak close).
Grey: Low-quality chop or indecision.
Best Practices for Use
Trend Quality: Avoid entering new trend-following positions when the score is below 40 (Chop).
Momentum Decay: Use the background highlights as a "caution" sign to tighten stops or take profits on existing runners.
Liquidity Sweeps: A confirmed sweep (triangle) indicates high-probability rejection, especially when the Trend Quality score is neutral or rotating.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.