OPEN-SOURCE SCRIPT
Trinity Magic MA Ribbon Pro

**Trinity Magic MA Ribbon Pro – User Guide**
### Overview
The **Trinity Magic MA Ribbon Pro** is a powerful multi-purpose technical indicator that combines a dynamic 3-line moving average ribbon with intelligent candle coloring.
It helps traders quickly identify:
- Trend direction (bullish / bearish)
- Trend strength and momentum
- Consolidation / ranging periods (when price is inside the ribbon)
- High-probability entry zones based on ribbon interaction
The indicator supports both **EMA** and **SMA** (user selectable), making it flexible for different trading styles and timeframes.
### Key Features
- **Adaptive 3-Line Ribbon**: High, HLC3, and Low moving averages create a visual “ribbon” that expands in strong trends and contracts in choppy markets.
- **Smart Candle Coloring**: Automatically colors candles based on their position relative to the ribbon (Bull / Bear / Neutral).
- **MA Type Switch**: Choose between **EMA** (more responsive) or **SMA** (smoother) directly in settings.
- **Visual Clarity**: Custom colors, transparency control, and optional line display.
- **Clean & Performant**: Built in Pine Script v6 with optimized code.
### How the Indicator Works
1. **Ribbon Construction**
- Three moving averages are calculated:
- **MA High** → based on `high` price
- **MA HLC3** → based on `(high + low + close)/3`
- **MA Low** → based on `low` price
- The area between the highest and lowest of these three MAs forms the **ribbon**.
2. **Ribbon Position States**
- **Bullish (Ribbon Below)**: Price is completely above the ribbon → strong uptrend.
- **Bearish (Ribbon Above)**: Price is completely below the ribbon → strong downtrend.
- **Neutral / Consolidation**: Price is trading inside the ribbon → ranging or weak trend.
3. **Color Logic**
- Ribbon lines and fill change color dynamically based on the dominant state.
- Candles are colored accordingly for instant visual confirmation.
### Settings Guide
#### MA Settings Group
| Setting | Description | Default |
|------------------------|-----------------------------------------------------------------------------|---------|
| **MA Type** | Choose between EMA (faster) or SMA (smoother) for all three lines | EMA |
| **MA High Period** | Length for the High-price MA | 20 |
| **MA HLC3 Period** | Length for the HLC3-price MA | 20 |
| **MA Low Period** | Length for the Low-price MA | 20 |
#### Ribbon Style Group
| Setting | Description | Default |
|-----------------------------|--------------------------------------------------------------------------|--------------|
| **Ribbon Fill Transparency**| Controls how see-through the ribbon fill is (0 = solid, 100 = invisible) | 80 |
| **Bull Ribbon Color** | Color when price is above the ribbon | Green |
| **Bear Ribbon Color** | Color when price is below the ribbon | Red |
| **Neutral Color 1** | Primary neutral color (used for middle line) | Orange |
| **Neutral Color 2** | Secondary neutral color (used for fill & outer lines) | Yellow |
| **Show MA Lines** | Toggle visibility of the three MA lines | On |
#### Candle Coloring Group
| Setting | Description | Default |
|----------------------------|------------------------------------------------------------------|-------------|
| **Color Candles Based on Ribbon** | Master switch for candle coloring | On |
| **Bull Body / Border / Wick** | Colors for bullish candles (price above ribbon) | Bright Green / Dark / Light |
| **Bear Body / Border / Wick** | Colors for bearish candles (price below ribbon) | Bright Red / Dark / Light |
| **Neutral Body / Border / Wick** | Colors for neutral candles (price inside ribbon) | Orange / Dark / Light |
### How to Use It Effectively
**Trend Trading**
- **Long entries**: Look for price breaking and closing above the ribbon with green candles.
- **Short entries**: Look for price breaking and closing below the ribbon with red candles.
- Use ribbon expansion (widening) as confirmation of strong momentum.
**Scalping / Intraday**
- Trade pullbacks to the ribbon in the direction of the dominant trend.
- Inside-ribbon (neutral) periods often precede breakouts.
**Reversal / Mean Reversion**
- When price is deep inside the ribbon for extended periods, prepare for potential breakout in either direction.
**Multi-Timeframe**
- Use higher timeframe ribbon (e.g., 15min or 1H) for bias and lower timeframe for entries.
**Best Practices**
- Combine with volume, support/resistance, or other confluences.
- Adjust periods based on timeframe (shorter for scalping, longer for swing trading).
- The default 20-20-20 works well on many instruments, especially SPY, NVDA, and other high-liquidity stocks/crypto.
### Visual Interpretation
- **Strong Bull Trend**: Wide green ribbon with price riding above it + green candles.
- **Strong Bear Trend**: Wide red ribbon with price under it + red candles.
- **Chop/Consolidation**: Narrow or overlapping ribbon with orange/yellow colors + neutral candles.
- Ribbon contraction often signals impending volatility expansion.
### Tips from the Developer (34ematrader)
- Start with default settings and tweak MA lengths to match your trading style.
- The HLC3 line often acts as a “balance point” — very useful for mean-reversion trades.
- Use the candle coloring as a filter: only take trades in the direction of the candle color.
### Overview
The **Trinity Magic MA Ribbon Pro** is a powerful multi-purpose technical indicator that combines a dynamic 3-line moving average ribbon with intelligent candle coloring.
It helps traders quickly identify:
- Trend direction (bullish / bearish)
- Trend strength and momentum
- Consolidation / ranging periods (when price is inside the ribbon)
- High-probability entry zones based on ribbon interaction
The indicator supports both **EMA** and **SMA** (user selectable), making it flexible for different trading styles and timeframes.
### Key Features
- **Adaptive 3-Line Ribbon**: High, HLC3, and Low moving averages create a visual “ribbon” that expands in strong trends and contracts in choppy markets.
- **Smart Candle Coloring**: Automatically colors candles based on their position relative to the ribbon (Bull / Bear / Neutral).
- **MA Type Switch**: Choose between **EMA** (more responsive) or **SMA** (smoother) directly in settings.
- **Visual Clarity**: Custom colors, transparency control, and optional line display.
- **Clean & Performant**: Built in Pine Script v6 with optimized code.
### How the Indicator Works
1. **Ribbon Construction**
- Three moving averages are calculated:
- **MA High** → based on `high` price
- **MA HLC3** → based on `(high + low + close)/3`
- **MA Low** → based on `low` price
- The area between the highest and lowest of these three MAs forms the **ribbon**.
2. **Ribbon Position States**
- **Bullish (Ribbon Below)**: Price is completely above the ribbon → strong uptrend.
- **Bearish (Ribbon Above)**: Price is completely below the ribbon → strong downtrend.
- **Neutral / Consolidation**: Price is trading inside the ribbon → ranging or weak trend.
3. **Color Logic**
- Ribbon lines and fill change color dynamically based on the dominant state.
- Candles are colored accordingly for instant visual confirmation.
### Settings Guide
#### MA Settings Group
| Setting | Description | Default |
|------------------------|-----------------------------------------------------------------------------|---------|
| **MA Type** | Choose between EMA (faster) or SMA (smoother) for all three lines | EMA |
| **MA High Period** | Length for the High-price MA | 20 |
| **MA HLC3 Period** | Length for the HLC3-price MA | 20 |
| **MA Low Period** | Length for the Low-price MA | 20 |
#### Ribbon Style Group
| Setting | Description | Default |
|-----------------------------|--------------------------------------------------------------------------|--------------|
| **Ribbon Fill Transparency**| Controls how see-through the ribbon fill is (0 = solid, 100 = invisible) | 80 |
| **Bull Ribbon Color** | Color when price is above the ribbon | Green |
| **Bear Ribbon Color** | Color when price is below the ribbon | Red |
| **Neutral Color 1** | Primary neutral color (used for middle line) | Orange |
| **Neutral Color 2** | Secondary neutral color (used for fill & outer lines) | Yellow |
| **Show MA Lines** | Toggle visibility of the three MA lines | On |
#### Candle Coloring Group
| Setting | Description | Default |
|----------------------------|------------------------------------------------------------------|-------------|
| **Color Candles Based on Ribbon** | Master switch for candle coloring | On |
| **Bull Body / Border / Wick** | Colors for bullish candles (price above ribbon) | Bright Green / Dark / Light |
| **Bear Body / Border / Wick** | Colors for bearish candles (price below ribbon) | Bright Red / Dark / Light |
| **Neutral Body / Border / Wick** | Colors for neutral candles (price inside ribbon) | Orange / Dark / Light |
### How to Use It Effectively
**Trend Trading**
- **Long entries**: Look for price breaking and closing above the ribbon with green candles.
- **Short entries**: Look for price breaking and closing below the ribbon with red candles.
- Use ribbon expansion (widening) as confirmation of strong momentum.
**Scalping / Intraday**
- Trade pullbacks to the ribbon in the direction of the dominant trend.
- Inside-ribbon (neutral) periods often precede breakouts.
**Reversal / Mean Reversion**
- When price is deep inside the ribbon for extended periods, prepare for potential breakout in either direction.
**Multi-Timeframe**
- Use higher timeframe ribbon (e.g., 15min or 1H) for bias and lower timeframe for entries.
**Best Practices**
- Combine with volume, support/resistance, or other confluences.
- Adjust periods based on timeframe (shorter for scalping, longer for swing trading).
- The default 20-20-20 works well on many instruments, especially SPY, NVDA, and other high-liquidity stocks/crypto.
### Visual Interpretation
- **Strong Bull Trend**: Wide green ribbon with price riding above it + green candles.
- **Strong Bear Trend**: Wide red ribbon with price under it + red candles.
- **Chop/Consolidation**: Narrow or overlapping ribbon with orange/yellow colors + neutral candles.
- Ribbon contraction often signals impending volatility expansion.
### Tips from the Developer (34ematrader)
- Start with default settings and tweak MA lengths to match your trading style.
- The HLC3 line often acts as a “balance point” — very useful for mean-reversion trades.
- Use the candle coloring as a filter: only take trades in the direction of the candle color.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.