gurple

DOW / GOLD Ratio

143 0 1
Here's a new version with color goodness and using CL1!             as the gold             spot source (longer history).
Remove from Favorite Scripts Add to Favorite Scripts
//study(title="DOW/GOLD", shorttitle="DOW/GLD", overlay=false)
//sym(s) => security(s, period, close)
//DOWVGLD = (sym("DOWI") / sym("XAUUSD"))
//len = input(260, minval=1, title="Length")
//out = ema(DOWVGLD, len)
//plot(out, title="EMA", color=green)
//plot(40, color=red)
//plot(30, color=#EBC87A)
//plot(5, color=blue)
//plot(3.20, color=red)
//plot(DOWVGLD, color=navy, linewidth=1)

// Below is version 2
study(title="DOW/GOLD", shorttitle="DOW/GLD", overlay=false)
sym(s) => security(s, period, close)
DOWVGLD = (sym("DOWI") / sym("GC1!"))
len = input(260, minval=1, title="EMA Length")
out = ema(DOWVGLD, len)

WARNING_HIGH = DOWVGLD > input(40, title="Equities Too Hot")
SWTCH_2_GLD = DOWVGLD > input(30, title="Switch to Gold")
TRANSITION = DOWVGLD > input(6, title="Transition State") // Market middle ground
SWTCH_2_EQTS = DOWVGLD < input(6, title="Switch to Equities")
WARNING_LOW = DOWVGLD < input(3.20, title="Gold Too Hot")

custcolor = WARNING_HIGH ? red : SWTCH_2_GLD ? #EBC87A : TRANSITION ? teal : SWTCH_2_EQTS ? purple : WARNING_LOW ? red : navy

plot(out, title="EMA", color=green)
//plot(40, color=red)
//plot(30, color=#EBC87A)
//plot(5, color=blue)
//plot(3.20, color=red)
plot(DOWVGLD, color=custcolor, linewidth=1)
English
English (UK)
English (IN)
Deutsch
Français
Español
Italiano
Polski
Türkçe
Русский
Português
Bahasa Indonesia
Bahasa Melayu
ภาษาไทย
Tiếng Việt
日本語
한국어
简体
台灣
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request