OPEN-SOURCE SCRIPT
3MA Alignment Ribbon [AlgoTraderPro]

3MA Alignment Ribbon [CSJ9] is a clean, visual trend-structure indicator based on the alignment of three moving averages.
Instead of focusing on crossovers, it highlights trend quality and direction by dynamically coloring the moving averages and the ribbon between them.
The goal is simple: See at a glance whether the market structure is bullish, bearish, or neutral.
⸻
How It Works
The indicator plots three moving averages (Fast, Medium, Slow) and evaluates their alignment:
The moving averages and the filled ribbon between them are automatically colored based on this alignment, making trend conditions immediately visible.
⸻
Key Features
✅Multi-MA Support
Choose between:
✅ Alignment Modes
✅ Optional Slope Filter
Filter signals by requiring the slow MA to be rising or falling, helping avoid false trend states during flat conditions.
✅ Higher Timeframe (HTF) Ribbon
Overlay the same 3MA alignment logic from a higher timeframe on your current chart:
✅ Alerts & Visual Signals
✅ Custom Styling
⸻
How to Use It
This indicator works best as:
It does not generate buy/sell signals by itself — instead, it helps you trade aligned with market structure.
⸻
Default Settings
The default lengths (50 / 100 / 200 EMA) are suitable for most markets and timeframes, including crypto, forex, indices, and equities.
Instead of focusing on crossovers, it highlights trend quality and direction by dynamically coloring the moving averages and the ribbon between them.
The goal is simple: See at a glance whether the market structure is bullish, bearish, or neutral.
⸻
How It Works
The indicator plots three moving averages (Fast, Medium, Slow) and evaluates their alignment:
- Bullish → Fast > Medium > Slow
- Bearish → Fast < Medium < Slow
- Neutral → Any other configuration
The moving averages and the filled ribbon between them are automatically colored based on this alignment, making trend conditions immediately visible.
⸻
Key Features
✅Multi-MA Support
Choose between:
- EMA (default)
- SMA
- WMA
- VWMA
- RMA
- HMA
✅ Alignment Modes
- Strict: classic Fast > Medium > Slow logic
- Tolerant: requires a minimum percentage separation between averages to reduce noise in ranging markets
✅ Optional Slope Filter
Filter signals by requiring the slow MA to be rising or falling, helping avoid false trend states during flat conditions.
✅ Higher Timeframe (HTF) Ribbon
Overlay the same 3MA alignment logic from a higher timeframe on your current chart:
- Fully optional
- Correctly calculated on the HTF itself
- Option to use confirmed HTF bars only (reduces repaint confusion)
✅ Alerts & Visual Signals
- Alerts when alignment turns Bullish, Bearish, or Neutral
- Optional on-chart markers when the alignment flips
✅ Custom Styling
- Fully customizable colors and transparency
- Designed to remain readable without cluttering the chart
⸻
How to Use It
This indicator works best as:
- A trend filter for discretionary trading
- A context tool for entries using other setups
- A market structure overlay for scalping, swing trading, or position trading
It does not generate buy/sell signals by itself — instead, it helps you trade aligned with market structure.
⸻
Default Settings
The default lengths (50 / 100 / 200 EMA) are suitable for most markets and timeframes, including crypto, forex, indices, and equities.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
Code. Structure. Execution.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
Code. Structure. Execution.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.