mattlacoco

GRaB Candles

ema
3054 4 567
ema
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)
Really good Candle indicator here
Reply
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)?
Reply
whitaker.lisa BradGrigor
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".
+1 Reply
mattlacoco BradGrigor
It's written how it's intended, for both blues and reds, the darker colors are bears while brighter colors are bulls.
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
日本
한국
Home Stock Screener Forex Signal Finder 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