Skip to content

Instantly share code, notes, and snippets.

@bkawk
Created April 6, 2018 15:14
Show Gist options
  • Save bkawk/dbefb68c87d4f7dd5997ce16180bf558 to your computer and use it in GitHub Desktop.
Save bkawk/dbefb68c87d4f7dd5997ce16180bf558 to your computer and use it in GitHub Desktop.
GhostBinary
//@version=2
study("GHOST Binary [@bkawk]", overlay = false)
slime = #B7ED0A
blood = #FF4167
fastMA = input(title="Fast Period", type = integer, defval = 12)
slowMA = input(title="Slow Period", type = integer, defval = 26)
signalSmooth = input(title="Smoothing Amount", type = integer, defval = 9)
tf = period
fst = security(tickerid, tf, ema(close, fastMA))
slw = security(tickerid, tf, ema(close, slowMA))
data = (fst - slw) - security(tickerid, tf, ema((fst - slw), signalSmooth))
color = if data > 0
data > data[1] ? slime : blood
else
data < data[1] ? blood : slime
plot(100, style = area, color = color)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment