1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.
Overview
SPX/Gold Ratio Bubble Detector tracks the ratio alongside a simple moving average and evaluates market status across customizable warning, danger, and extreme thresholds. The script draws the ratio line, moving average, threshold bands, and condition tags in a separate pane. Users can adjust the underlying symbols, threshold tiers, moving average length, and toggle visual elements or alert conditions.
SPX to Gold relative valuation ratio
Multi-tier threshold zones for bubble detection
Simple moving average baseline smoothing
Normalized 0-100 bubble signal strength calculation
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
SPX Symbol (ETF)
symbol
SPY
spx_symbol
Gold Symbol (ETF)
symbol
GLD
gold_symbol
Bubble Warning Level
float
2.0
bubble_warning
Bubble Danger Level
float
2.3
bubble_danger
Bubble Extreme Level
float
2.6
bubble_extreme
Show Ratio Line
bool
true
show_ratio
Show Moving Average
bool
true
show_ma
Show Threshold Bands
bool
true
show_bands
Show Bubble Signals
bool
true
show_signals
Moving Average Length
int
50
ma_length
Enable Alerts
bool
true
enable_alerts
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
BTC Multiples calculates and displays Bitcoin macro valuation metrics in a separate pane, including the Mayer Multiple, Stock-to-Flow Multiple, Difficulty Multiple, and Puell Multiple. Each valuation multiple features configurable overvalued and undervalued th
MACD Breakout builds a higher-timeframe MACD from preset fast and slow lengths using SMA or EMA, and marks support and resistance zones from histogram sensitivity. Optional filters require zero-line agreement, higher-timeframe direction, and linear-regression
This Pine Script indicator plots multiple exponential moving averages in a separate pane for technical analysis. It calculates Elliott wave EMAs using Fibonacci wave counts of 34 and 89, plus 200-session and golden ratio lines. Additional Pythagorean cloud lev
Cipher B is a multi-indicator plotting WaveTrend oscillator lines and signals alongside Stochastic RSI, MFI area with color bars, and buy sell marks. It draws all elements in a separate pane. WaveTrend calculates using SMMA and EMA on source like ohlc4 with ad
This indicator demonstrates debugging visualization patterns for Pine Script. It plots value tracking with mean, min, and max reference lines, condition markers using shapes and arrows, historical comparisons with standard deviation bands, multi-series overlay
This indicator renders Ichimoku cloud components consisting of conversion line, base line, leading span A and leading span B. It tracks Tenkan-Kijun crosses and assigns a numeric score to each based on whether the cross occurs below, inside or above the Kumo c