Gold Ribbon V1.00Gold Ribbon V1.00
Pine Script V6 · TradingView Indicator
A multi-MA ribbon indicator built exclusively for XAUUSD trading — trend detection, squeeze alerts, and dynamic TP/SL management in one system.
• 8 Moving Averages
• Fibonacci Sequence
• Squeeze Detection
• Auto TP / SL
• Best on 15M · 1H
---
01. What Is Gold Ribbon?
Gold Ribbon V1.00 is a trend-following ribbon indicator purpose-built for Gold (XAUUSD). It stacks eight Exponential Moving Averages in Fibonacci-sequence lengths — 5, 8, 13, 21, 34, 55, 89, and 144 — to form a visual "ribbon" that bends, compresses, and expands with the market's momentum.
When the ribbon is in Perfect Order (all 8 MAs stacked cleanly), the trend is high-confidence. When the ribbon compresses into a tight band, a breakout is loading. This single visual gives you trend direction, momentum strength, and market state — all at once.
• Trend Detection: Perfect Order logic identifies true bull and bear phases with all 8 MAs aligned.
• Squeeze Alert: Detects when the ribbon compresses — signaling a high-energy breakout is imminent.
• Auto TP / SL: Calculates dynamic Take Profit and Stop Loss levels from price-to-ribbon distance.
02. How to Add It to TradingView
1. Open Pine Script Editor: In TradingView, open the chart for XAUUSD. At the bottom, click Pine Editor. Paste the full Gold Ribbon V1.00 source code.
2. Save and Add to Chart: Click Save, then click Add to chart. The ribbon will appear overlaid on the candles immediately.
3. Set the Correct Timeframe: Switch to the 15-minute or 1-hour chart. The indicator is optimized for these timeframes. A warning will appear on-chart if you go above 1H intraday.
4. Open Settings (⚙️ Gear Icon): Click the indicator's gear icon on the chart to open the Settings panel. All customizable inputs are organized in labeled groups inside this panel.
03. Reading the Ribbon — Market States
The ribbon always shows one of four market states. A live label appears at the right edge of the chart showing the current state.
▲ BULLISH — Perfect Bull Order
All 8 MAs are stacked M1 > M2 > … > M8. Gold is in a clean uptrend. The ribbon fills green. Look for buy setups only. The stronger the separation between MAs, the stronger the trend.
▼ BEARISH — Perfect Bear Order
All 8 MAs are stacked M1 < M2 < … < M8. Gold is in a confirmed downtrend. The ribbon fills red. Look for sell setups only. Avoid buying into a bearish ribbon.
◆ SQUEEZE — Compression Detected
The ribbon has tightened below its average width. Gold is coiling energy before a breakout. Do not trade blindly — wait for the ribbon to expand and Perfect Order to form before entering. Orange diamonds appear along the ribbon mid-line.
~ CHOPPY — No Clear Trend
MAs are tangled and not in order. The ribbon fills gray. This is a no-trade zone. Signals during choppy conditions have low reliability. Step aside and wait.
04. The 8 Moving Averages Explained
The lengths follow the Fibonacci sequence — 5, 8, 13, 21, 34, 55, 89, 144 — a progression that naturally mirrors how Gold trends unfold across time cycles.
• MA 5: Fastest · Reacts to every tick
• MA 8: Short-term momentum
• MA 13: Early trend confirmation
• MA 21: Core trend driver
• MA 34: Medium-term structure
• MA 55: Institutional bias level
• MA 89: Macro trend filter
• MA 144: Slowest · Major support/resistance
Note: The MA 144 is also used as the Stop Loss anchor — price must hold above it (long) or below it (short) for the trade to remain valid.
05. Trading Signals
The indicator generates two types of signals — Standard and High Probability. Both require Perfect Order to be active.
• Standard Buy ▲
Small green triangle below the bar. Conditions: Perfect Bull Order + price above MA5 + MA144 is rising over 3 bars. One signal per trend — no repeats until trend resets.
• Standard Sell ▼
Small red triangle above the bar. Conditions: Perfect Bear Order + price below MA5 + MA144 is falling over 3 bars. One signal per trend.
• 🚀 High Prob BUY
Large green label with a rocket icon. Only fires when a Squeeze expansion happened recently before the bull trend formed — highest conviction setup.
• 🚀 High Prob SELL
Large red label with a rocket icon. Same logic — squeeze expansion followed by Perfect Bear Order. This is the premium signal to prioritize.
⚡ Signal Priority Rule: Always prioritize 🚀 High Probability signals over standard triangles. A squeeze expansion before a trend often precedes the largest Gold moves. Wait for these setups patiently.
06. How to Execute a Trade
Once a signal fires and the ribbon is in Perfect Order, the indicator automatically draws TP1, TP2, and SL lines based on the distance between the current close price and MA144.
LONG TRADE SETUP
• Entry: Current close price when 🚀 BUY fires
• TP1: Entry + (Entry − MA144) × 0.5
• TP2: Entry + (Entry − MA144) × 1.0
• Stop Loss: MA144 × 0.998 (just below MA144)
SHORT TRADE SETUP
• Entry: Current close price when 🚀 SELL fires
• TP1: Entry − (MA144 − Entry) × 0.5
• TP2: Entry − (MA144 − Entry) × 1.0
• Stop Loss: MA144 × 1.002 (just above MA144)
💡 TP/SL Management Tip: Take partial profit at TP1 (50% of position), then move your Stop Loss to breakeven. Let the remaining 50% run toward TP2. Exit fully if the ribbon loses Perfect Order before TP2 is reached.
07. Customizable Settings
All inputs are in the Settings panel (gear icon). Here's what you can change and what each setting does:
📊 RIBBON MAs — Moving Average Settings
• MA 1–8 Length: Default lengths are Fibonacci (5 to 144). You can adjust these, but the Fibonacci sequence is recommended for Gold.
• MA 1–8 Type: Choose between EMA, SMA, WMA, or HMA. Default is EMA.
• MA 1–8 Width: Line thickness. Increase to 2–3 for larger screens.
• Show MA 1–8: Toggle visibility of individual MAs to reduce visual clutter.
🎨 RIBBON FILL — Color Settings
• Use Dynamic Trend Colors: When ON, all MA lines turn green in a bull trend and red in a bear trend. Highly recommended.
• Bullish / Bearish / Neutral Fill: Customize the fill color for each market state.
🎯 SIGNALS — Signal Display Settings
• Show Signals: Master toggle for all buy/sell markers.
• Show TP/SL Lines: Toggle the automatic Take Profit and Stop Loss lines on the right side of the chart.
• TP/SL Label Size: Default is Tiny to keep the chart clean.
💥 SQUEEZE DETECTION
• Show Squeeze Markers: Toggle the orange diamond markers.
• Squeeze Sensitivity: Range 0.1 to 0.9. Default is 0.4. For volatile Gold sessions, 0.35–0.45 works best.
🏷️ TREND LABELS
• Show Labels: Toggle the live trend label indicating the current market state.
08. Trading the Squeeze — Gold's Secret Weapon
Gold (XAUUSD) is notorious for long periods of low-volatility consolidation followed by explosive breakouts. The Squeeze Detection in Gold Ribbon is designed specifically to catch these moments.
1. Ribbon compresses → Orange diamonds appear: The ribbon width drops below 40% of its 50-bar average. Gold is coiling. Stand aside. Do not chase price in this state.
2. Ribbon begins expanding → "Expanding" crossover fires: The ribbon width crosses back above the threshold. Watch which direction price moves and whether Perfect Order is forming.
3. 🚀 High Probability signal fires: If Perfect Order locks in right after an expansion, a High Probability label appears. Enter with full conviction.
4. Manage with TP1 → Breakeven → TP2: Use the auto-drawn TP/SL lines. Scale out at TP1, protect the rest, and target TP2 while the ribbon holds Perfect Order.
09. Setting Up Alerts
Gold Ribbon fires three built-in alerts you can activate in TradingView. Right-click the indicator name on the chart → Add Alert on Gold Ribbon V1.00.
• 🟢 BUY Signal: Fires once per bar when a Buy condition triggers.
• 🔴 SELL Signal: Fires once per bar when a Sell condition triggers.
• ⚠️ SQUEEZE Alert: Fires when the ribbon enters compression for the first time.
📱 Mobile Alert Tip: Set alerts to Push Notification on your TradingView account. This way Gold Ribbon notifies your phone instantly when a squeeze starts or a High Probability signal fires.
10. Best Practices for Gold Trading
✅ Do This: Use on 15M or 1H charts only. Only trade in the direction of Perfect Order. Prioritize 🚀 High Prob signals. Wait for squeeze expansion before entering. Always use the auto-generated SL level.
❌ Avoid This: Trading during CHOPPY state. Entering against the ribbon direction. Ignoring the SL line. Using on daily/weekly timeframes without recalibrating lengths. Fighting a strong ribbon trend.
⚠️ Timeframe Warning: If you use an intraday timeframe above 1H, the indicator will display a red warning banner at the top-left of the chart. The default MA lengths are calibrated for scalping and intraday sessions. For swing trading on higher timeframes, consider increasing MA lengths proportionally.
Pine Script® Indikator






