OPEN-SOURCE SCRIPT
Aggiornato

Bull Market Support Band (20W SMA + 21W EMA)

926
🟩 Bull Market Support Band (20W SMA + 21W EMA) [v6]

OVERVIEW

The Bull Market Support Band is a long-term trend indicator that combines the 20-week SMA and 21-week EMA.
When price is above the band → bullish trend.
When below → bearish trend.
When within → neutral or transition phase.
This v6 version adds full customization, dynamic coloring, event labels, candle coloring, and a configurable on-chart legend table with trend arrows.

HOW IT WORKS
  • Calculates the 20W SMA and 21W EMA from a user-selectable higher timeframe (weekly by default).
  • Plots both averages and shades the area between them to form the support band.
  • The fill and line colors change automatically based on the market phase:
     🟩 Green = Bullish (price above)
     🟥 Red = Bearish (price below)
     ⬜ Gray = Neutral (price within).
  • Labels appear only when the trend state changes.
  • Alerts trigger when price crosses the band or either moving average.
  • Optional candle coloring applies the same bull/bear/neutral logic to price bars.
  • A convenience legend table displays current 20W SMA and 21W EMA values, along with slope arrows (^, v, =).


INCLUDED FEATURES
  • Configurable calculation timeframe.
  • Automatic band fill and line coloring.
  • Optional candle coloring overlay.
  • Compact or detailed regime-change labels.
  • ATR-based label offset and spacing control.
  • Customizable legend table with background color.
  • Horizontal or vertical legend layout.
  • Custom arrow characters (ASCII or Unicode).
  • Built-in alerts for band and MA crosses.
  • Optimized for higher-timeframe accuracy using request.security().


USAGE TIPS
  • Keep the default weekly setting for macro trend context.
  • On lower chart timeframes, use the band as higher-level support/resistance.
  • Combine with momentum or volume indicators (RSI, MACD, OBV) for confirmation.
  • Adjust ATR multiplier to move labels further from price candles.
  • Increase “Min bars between labels” to reduce visual clutter.
  • Disable auto-coloring if you prefer a static color theme.
  • Toggle compact legend or switch between horizontal/vertical layouts for best fit.


INTERPRETATION GUIDE
  • 🟩 Bullish: Price above the band → trend continuation likely.
  • Neutral: Price within the band → consolidation or potential reversal zone.
  • 🟥 Bearish: Price below the band → downtrend continuation or distribution.

Sustained closes above or below the band typically align with major market cycle shifts.

NOTES
  • Uses request.security() for higher-timeframe precision — accurate even on smaller charts.
  • The legend table is screen-anchored and remains fixed as you pan or zoom.
  • Plots and labels are price-anchored and move with candles.
  • Lightweight and efficient for all markets and intervals.


CREDITS

Original concept: The Bull Market Support Band (popularized in crypto analysis).
Enhanced Pine Script v6 version: Ricco.
Modernized for clarity, flexibility, and multi-timeframe accuracy.

SUMMARY

A modern, customizable Bull Market Support Band indicator highlighting long-term market regimes with clean visuals, color logic, and convenience features.
Designed for traders seeking macro clarity, minimal clutter, and professional presentation.
Note di rilascio
Bull Market Support Band (20W SMA + 21W EMA)

OVERVIEW
This indicator recreates and enhances the well-known Bull Market Support Band concept using the 20-week Simple Moving Average (SMA) and the 21-week Exponential Moving Average (EMA).
It identifies long-term bullish or bearish regimes based on price position relative to these two averages, while also providing improved visualization, alerts, and contextual tools.



HOW IT WORKS
  • The script requests weekly data for both the 20-period SMA and 21-period EMA using request.security().
  • It forms a dynamic channel (the “support band”) between the higher of the two (upper bound) and the lower (lower bound).
  • Market phase is determined by price relation to this band: above (bull), within (neutral), below (bear).
  • Color logic updates automatically: green for bullish, red for bearish, gray for neutral.
  • Regime changes are detected when the state flips, triggering optional labels and alert conditions.
  • A volatility-scaled offset (ATR) controls label spacing to avoid clutter.
  • An optional legend table displays live SMA/EMA values and slope arrows showing whether each line is rising or falling.




WHAT’S NEW IN V6
  • Full Pine Script v6 rewrite for performance and readability.
  • Customizable legend layout (horizontal or vertical).
  • Configurable color themes and arrow symbols.
  • Optional candle coloring synced to market regime.
  • Cleaner label handling and ATR-based spacing.
  • Alerts for price crossing the band or either MA.




USAGE
  • Best viewed on a Weekly chart for macro-trend confirmation.
  • Works on any timeframe; weekly calculations remain accurate.
  • Use the band as dynamic support/resistance or trend filter.
  • Above band = strong uptrend bias.
  • Below band = long-term downtrend bias.
  • Within band = potential transition or consolidation zone.




CREDITS
Concept inspired by the original Bull Market Support Band from crypto market analysis.
Enhanced Pine v6 version by Ricco, featuring additional customization, visual improvements, and alerts.



NOTES
  • This script uses only standard moving-average and volatility logic as described.
  • No repainting occurs; calculations are based on confirmed bar closes.
  • Suitable for all assets including crypto, forex, and equities.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.