DOW / GOLD Ratio (gurple)

45 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)
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية
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 Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out