DOW / GOLD Ratio

87 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)
Ideas Scripts Chart
United States
United Kingdom
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out