OPEN-SOURCE SCRIPT
Atualizado MARs - Moving Average Ribbon Scirocco

Initially, I decided to build this indicator simply to bundle multiple moving averages together under a single script to save chart space. However, I chose to completely overhaul and improve the design to transform it into an institutional-grade, multi-timeframe trend visualization and analysis system.
Optimized for dark-theme chart layouts and named after the high-velocity, dust-carrying desert windstorms, the Moving Average Ribbon Scirocco (MARs) unifies independent multi-timeframe data structures, directional price momentum, and volume-weighted confirmation thresholds into a single, cohesive channel overlay.
Why MARs is Useful
- Eliminates Screen Flipping: Traditional charting ribbons require constant switching between multiple chart intervals to stay aligned with the dominant trend. MARs solves this by anchoring independent timeframe inputs to each of the four moving averages individually. This allows you to track multiple higher-timeframe macro baselines (like 4-hour, Daily, or Weekly trends) directly on a lower execution chart (like a 1-minute or 5-minute chart) without constantly changing screens or splitting your workspace.
- Absolute Momentum Slope Vectoring: MARs circumvents this by ditching screen-based spatial positioning entirely. Instead, it utilizes absolute slope momentum vectors calculated through sequential ta.rising() and ta.falling() states on the underlying series. This mathematical approach guarantees that the directional colors remain locked to their true momentum axes regardless of how high or low your active chart grid is scaled.
- Fixes Color Inversions: Standard multi-timeframe ribbons rely on a simple visual overlay, which causes the colors to flip backwards or invert when you move to a higher chart interval due to historical bar compression. MARs isolates momentum trends at their native calculation source to keep color maps perfectly accurate on all scales.
What Makes It Unique
- Persistent Visual Framework: Standard ribbons break or return an na element the moment a user toggles a single line off in the settings menu. MARs solves this via a dynamic boundary engine built with algorithmic math.max() and math.min() arrays paired with non-zero element converters (nz()).
- Adaptive Anchor Logic: The indicator reads your active user checkbox selections bar-by-bar in real-time; if you hide individual moving averages to clean up your workspace, the background cloud instantly re-anchors itself to the next closest visible line, keeping the channel fill functional.
- Universal Asset Compatibility: Standard indicators with volume-weighted elements crash or turn completely invisible when applied to assets that lack native volume tracking data (such as Forex spot pairs, Crypto CFDs, Commodities, or indices like SPX).
- Volume Safety Net: MARs features an automated volume safety-net mechanism that samples a 10-period smoothing filter. If it detects zero volume, the script instantly bypasses the volume engine and defaults to a stable, visible base opacity, providing a seamless analysis experience across all financial asset classes.
Finding Your Own Way to Use It
- No Rigid Signals: Because MARs was explicitly engineered without rigid, pre-programmed "buy/sell" arrow signals or directional labels, it does not dictate how you must trade.
- Discover Your Own Edge: The true value of the indicator comes from discovering your own systematic edge through a personalized combination of moving average styles (SMA, EMA, SMMA, WMA, or VWMA), customized lengths, and specific timeframe steps.
- Objective Toolkit: By stripping away prescriptive text and leaving interpretation to the trader, MARs functions as an objective diagnostic toolkit that can be customized for short-term intraday momentum scalping, long-term swing trading, or indicator-on-indicator sourcing.
Core Functionality
- Dual-State Volume Confirmation Engine: Evaluates price expansion against a 20-period simple moving average of volume. The background channel instantly brightens into high-visibility thermal colors when structural expansion is backed by institutional volume, and automatically mutes its opacity when volume drops below average to warn you of low-participation breakouts.
- Anti-Repaint Protective Framework: Technical calculation loops are isolated inside encapsulated function blocks via request.security() with barmerge.lookahead_off. This guarantees that your historical chart lines are locked into place exactly as they appeared in real-time, eliminating future-data leaking and data distortion.
- Achromatic Martian Thermal Palette: Designed specifically to reduce eye strain and eliminate visual fatigue during long trading sessions on dark background layouts. The moving average lines form a clean, static gradient, while the background fill shifts between Vibrant Solar Gold, Martian Core Orange, and Molten Crimson Red, fading completely into a dark Obsidian Gray mask to tell you exactly when the market has flattened out into a tight consolidation squeeze.
Fully Customizable Theme: If you are not satisfied with these default theme selections, the color scheme remains fully customizable, allowing you to re-map both the individual lines and the background cloud states via the TradingView interface to match your exact visual preference.
Conclusion
The Moving Average Ribbon Scirocco (MARs) marks a complete overhaul of traditional charting ribbons, transforming a standard space-saving bundle into a robust, multi-timeframe trend analysis system. By filtering noise through volume validation, securing lines against historical repainting, and utilizing absolute slope vectors to permanently prevent color inversions, the indicator delivers an objective, mathematically precise overview of the market.
Ultimately, MARs serves as a versatile, high-contrast diagnostic toolkit designed to integrate cleanly into your workspace, giving you the freedom to build, refine, and execute your own systematic trading edge.
Optimized for dark-theme chart layouts and named after the high-velocity, dust-carrying desert windstorms, the Moving Average Ribbon Scirocco (MARs) unifies independent multi-timeframe data structures, directional price momentum, and volume-weighted confirmation thresholds into a single, cohesive channel overlay.
Why MARs is Useful
- Eliminates Screen Flipping: Traditional charting ribbons require constant switching between multiple chart intervals to stay aligned with the dominant trend. MARs solves this by anchoring independent timeframe inputs to each of the four moving averages individually. This allows you to track multiple higher-timeframe macro baselines (like 4-hour, Daily, or Weekly trends) directly on a lower execution chart (like a 1-minute or 5-minute chart) without constantly changing screens or splitting your workspace.
- Absolute Momentum Slope Vectoring: MARs circumvents this by ditching screen-based spatial positioning entirely. Instead, it utilizes absolute slope momentum vectors calculated through sequential ta.rising() and ta.falling() states on the underlying series. This mathematical approach guarantees that the directional colors remain locked to their true momentum axes regardless of how high or low your active chart grid is scaled.
- Fixes Color Inversions: Standard multi-timeframe ribbons rely on a simple visual overlay, which causes the colors to flip backwards or invert when you move to a higher chart interval due to historical bar compression. MARs isolates momentum trends at their native calculation source to keep color maps perfectly accurate on all scales.
What Makes It Unique
- Persistent Visual Framework: Standard ribbons break or return an na element the moment a user toggles a single line off in the settings menu. MARs solves this via a dynamic boundary engine built with algorithmic math.max() and math.min() arrays paired with non-zero element converters (nz()).
- Adaptive Anchor Logic: The indicator reads your active user checkbox selections bar-by-bar in real-time; if you hide individual moving averages to clean up your workspace, the background cloud instantly re-anchors itself to the next closest visible line, keeping the channel fill functional.
- Universal Asset Compatibility: Standard indicators with volume-weighted elements crash or turn completely invisible when applied to assets that lack native volume tracking data (such as Forex spot pairs, Crypto CFDs, Commodities, or indices like SPX).
- Volume Safety Net: MARs features an automated volume safety-net mechanism that samples a 10-period smoothing filter. If it detects zero volume, the script instantly bypasses the volume engine and defaults to a stable, visible base opacity, providing a seamless analysis experience across all financial asset classes.
Finding Your Own Way to Use It
- No Rigid Signals: Because MARs was explicitly engineered without rigid, pre-programmed "buy/sell" arrow signals or directional labels, it does not dictate how you must trade.
- Discover Your Own Edge: The true value of the indicator comes from discovering your own systematic edge through a personalized combination of moving average styles (SMA, EMA, SMMA, WMA, or VWMA), customized lengths, and specific timeframe steps.
- Objective Toolkit: By stripping away prescriptive text and leaving interpretation to the trader, MARs functions as an objective diagnostic toolkit that can be customized for short-term intraday momentum scalping, long-term swing trading, or indicator-on-indicator sourcing.
Core Functionality
- Dual-State Volume Confirmation Engine: Evaluates price expansion against a 20-period simple moving average of volume. The background channel instantly brightens into high-visibility thermal colors when structural expansion is backed by institutional volume, and automatically mutes its opacity when volume drops below average to warn you of low-participation breakouts.
- Anti-Repaint Protective Framework: Technical calculation loops are isolated inside encapsulated function blocks via request.security() with barmerge.lookahead_off. This guarantees that your historical chart lines are locked into place exactly as they appeared in real-time, eliminating future-data leaking and data distortion.
- Achromatic Martian Thermal Palette: Designed specifically to reduce eye strain and eliminate visual fatigue during long trading sessions on dark background layouts. The moving average lines form a clean, static gradient, while the background fill shifts between Vibrant Solar Gold, Martian Core Orange, and Molten Crimson Red, fading completely into a dark Obsidian Gray mask to tell you exactly when the market has flattened out into a tight consolidation squeeze.
Fully Customizable Theme: If you are not satisfied with these default theme selections, the color scheme remains fully customizable, allowing you to re-map both the individual lines and the background cloud states via the TradingView interface to match your exact visual preference.
Conclusion
The Moving Average Ribbon Scirocco (MARs) marks a complete overhaul of traditional charting ribbons, transforming a standard space-saving bundle into a robust, multi-timeframe trend analysis system. By filtering noise through volume validation, securing lines against historical repainting, and utilizing absolute slope vectors to permanently prevent color inversions, the indicator delivers an objective, mathematically precise overview of the market.
Ultimately, MARs serves as a versatile, high-contrast diagnostic toolkit designed to integrate cleanly into your workspace, giving you the freedom to build, refine, and execute your own systematic trading edge.
Notas de Lançamento
Functional Code UpgradesWrapped the request.security execution inside the fixnan() function to prevent indicator lines from breaking or disappearing due to historical data gaps when using higher timeframes.
Description Enhancements
Restructured all section headers and upgraded code comments from generic programmatic labels to institutional explanations detailing how changes impact market trend tracking and liquidity isolation.
Notas de Lançamento
Visual Update: 3D Tunnel Ribbon Gradient- Added ribbon_center Anchor Line: Dynamically tracks the absolute mathematical mid-point between the highest and lowest active moving averages.
- Implemented Split-Channel Fill Engine: Divided Section 6 into independent upper and lower background fills to enable symmetric vertical gradients.
- Enhanced Cloud Aesthetics: Transitioned the ribbon cloud from a solid background block to a smooth 3D tunnel gradient that fades from a rich center core into complete transparency at the outer boundaries, preserving original hex color configurations.
Notas de Lançamento
Added new setting:Master trend line tracker selector. Added the option to select which moving average determines trend color.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.