DOW / GOLD Ratio

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)


Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Refer a friend My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out