gurple

DOW / GOLD Ratio (gurple)

33 0 4
Does what it says on the tin.
Remove from Favorite Scripts Add to Favorite Scripts
study(title="DOW vs. GOLD Ratio", shorttitle="DOW/GOLD", overlay=false)
sym(s) => security(s, period, close)
DOWvGOLD = (sym("DOWI") / sym("GC1!"))
len = input(260, minval=1, title="EMA Length")
out = ema(DOWvGOLD, len)

//
lltssrc = DOWvGOLD
lltslen=input(90, minval=1, title="Length")
lltsout = ema(lltssrc, lltslen)
data = lltssrc/lltsout

buy = data > 1
sell = data < 1

lltscolor = buy ? olive : sell ? orange : blue
//

WARNING_HIGH = DOWvGOLD > input(40, title="Equities Too Hot")
SWTCH_2_GLD = DOWvGOLD > input(30, title="Switch to Gold")
TRANSITION = DOWvGOLD > input(6, title="Transition State") // Market middle ground
SWTCH_2_EQTS = DOWvGOLD < input(6, title="Switch to Equities")
WARNING_LOW = DOWvGOLD < 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=lltscolor)
plot(DOWvGOLD, color=custcolor, linewidth=1, trackprice=true)
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
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 Billing Sign Out