GRaB Candles

2785 4 528
Update to previous script.

Raghee Horners Wave and GRaB candles. Now show/hide the EMA "Wave". Paints candles according to close position relative to ema on high, low and close. Buy blue sell red.
Remove from Favorite Scripts Add to Favorite Scripts
study(title='Buy Blue Sell Red', shorttitle='BBSR', overlay=true)
// vars
emaPeriod = input(title="EMA Period", type=integer, defval=34)
showWave = input(title="Show Wave", type=bool, defval=false)

// build wave
emaHigh = ema(high,emaPeriod)
emaLow = ema(low,emaPeriod)
emaClose = ema(close,emaPeriod)

waveHigh = showWave == true ? emaHigh : na
waveLow = showWave == true ? emaLow : na
waveClose = showWave == true ? emaClose : na

plot(waveHigh, title="EMA High",color=red )
plot(waveLow, title="EMA Low", color=blue)
plot(waveClose, title="EMA Close", color=silver)

// paint candles according to close position relative to wave
barcolor(close < emaLow ? close > open ? red : maroon : close > emaHigh ? close > open ? blue : navy : close > open ? silver : gray)

Related Ideas

Really good Candle indicator here
2 years ago
Hi, there. Just wondering if on line 20 the term "close > open ? red : maroon" should be "close < open ? red : maroon" so that red would be the mirror image of blue (buy blue, sell red)?
whitaker.lisa BradGrigor
a year ago
I made this edit to the script and it worked fine. Makes more sense too as I can now consider that "darker shade is a counter-candle".
mattlacoco BradGrigor
a year ago
It's written how it's intended, for both blues and reds, the darker colors are bears while brighter colors are bulls.
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