The GRaB candlesticks indicator draws candlesticks of 3 different colours according to the actual trend calculated with a combination of 3 exponential moving average of the same period but applied to high, low and close:
– 34 period exponential moving average on the high
– 34 period exponential moving average on the close
– 34 period exponential moving average on the low
(periods and moving average type can be modified in the indicator parameter to find the more suitable sets for each instrument and timeframe).
According to the original author of this tool, this is how it should be used:
GRaB Candles are an extension of my 34EMA Wave and are simply a visual tool. I use them to determine the momentum and organization of a market trend. They are also a nice tool to use for traders looking at multiple charts and screens. They make my charts “glance-able” – in other words – I can make a some important decisions about price action on a specific time frame quickly “at a glance”. Typically an uptrend will have almost all green GRaB candles, a downtrend will have almost all red GRaB candles, and the more grey GRaB candles that I see, the higher the likelihood that the trend is correcting and/or in transition or that the market is trend is sideways (accumulation or distribution).
This indicator has been translated from 3 different MQL4 ones (1 for each candlestick type), by a request on English ProBuilder forum.
//PRC_GRaB candlesticks | indicator
//01.03.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from MT4 code
//--- parameters
// EMAperiod=34
// mmTYPE=1 (mm type)
// ---
EMAh = average[EMAperiod,mmTYPE](high)
EMAl = average[EMAperiod,mmTYPE](low)
EMAc = average[EMAperiod,mmTYPE](close)
bodyhigh = max(open,close)
bodylow = min(open,close)
if(open<=close and close > EMAH) then
LongWickUp = high
LongCandleUp = bodyHigh
LongWickDown = low
LongCandleDown = bodyLow
elsif(open>=close and close > EMAH) then
LongWickUp = low
LongCandleUp = bodyLow
LongWickDown = high
LongCandleDown = bodyHigh
elsif(open<=close and close < EMAL) then
ShortWickUp = high
ShortCandleUp = bodyHigh
ShortWickDown = low
ShortCandleDown = bodyLow
elsif(open>=close and close < EMAL) then
ShortWickUp = low
ShortCandleUp = bodyLow
ShortWickDown = high
ShortCandleDown = bodyHigh
elsif(open<=close and close < EMAH and close > EMAL) then
RangeWickUp = high
RangeCandleUp = bodyHigh
RangeWickDown = low
RangeCandleDown = bodyLow
elsif(open>=close and close < EMAH and close > EMAL) then
RangeWickUp = low
RangeCandleUp = bodyLow
RangeWickDown = high
RangeCandleDown = bodyHigh
endif
//bullish candlesticks
if close>EMAH then
DRAWCANDLE(LongCandleDown,LongWickUp,LongWickDown,LongCandleUp) coloured(0,200,0)
endif
//bearish candlesticks
if close<EMAL then
DRAWCANDLE(ShortCandleDown,ShortWickUp,ShortWickDown,ShortCandleUp) coloured(200,0,0)
endif
//neutral candlesticks (range)
if close<EMAH and close>EMAL then
DRAWCANDLE(RangeCandleDown,RangeWickUp,RangeWickDown,RangeCandleUp) coloured(150,150,150)
endif
RETURN EMAH coloured(100,100,100) style(dottedline) as "high EMA", EMAL coloured(100,100,100) style(dottedline) as "low EMA", EMAC coloured(100,100,100) style(point) as "trend EMA"
You must be logged in to post a comment.
bonjour Nicolas, bravo pour cet indicateur assez complexe et qui fonctionne parfaitement. sincèrement je n'y serais pas parvenu moi même. d'ailleurs j'ai essayé sans succès de me servir du fond pour générer un screener qui déclencherait des signaux à la hausse ou à la baisse lors de cassure du ruban en clôture. mais il y a trop de if et de elsif pour arriver à transformer tout ça en C1, C2, etc ... alors évidemment je me tourne vers vous. si vous pouviez réaliser un tel screener, ce serait génial. et alors avec en plus une flèche basse ou haute de couleurs pour préciser le signal, alors là ... ce serait la cerise sur le gâteau ! merci d'avance :-)))
How would you change candlesticks to "heiken Ashi" Candles.Please advise
Nicolas,
I added some lines to the indicator you translated. They reflect the setting that Raghee Horner is using in her webinars. She uses light color candles when the close is higher than the open and dark color candles when close is lower than open.
//PRC_GRaB candlesticks | indicator
//01.03.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from MT4 code
//--- parameters
EMAperiod=34
mmTYPE=1 //(mm type)
// ---
EMAh = average[EMAperiod,mmTYPE](high)
EMAl = average[EMAperiod,mmTYPE](low)
EMAc = average[EMAperiod,mmTYPE](close)
bodyhigh = max(open,close)
bodylow = min(open,close)
if(open<=close and close > EMAH) then
LongWickUp = high
LongCandleUp = bodyHigh
LongWickDown = low
LongCandleDown = bodyLow
r=50
g=200
b=0
elsif(open>=close and close > EMAH) then
LongWickUp = low
LongCandleUp = bodyLow
LongWickDown = high
LongCandleDown = bodyHigh
r=50
g=150
b=0
elsif(open<=close and close < EMAL) then
ShortWickUp = high
ShortCandleUp = bodyHigh
ShortWickDown = low
ShortCandleDown = bodyLow
r=200
g=50
b=0
elsif(open>=close and close < EMAL) then
ShortWickUp = low
ShortCandleUp = bodyLow
ShortWickDown = high
ShortCandleDown = bodyHigh
r=150
g=50
b=0
elsif(open<=close and close < EMAH and close > EMAL) then
RangeWickUp = high
RangeCandleUp = bodyHigh
RangeWickDown = low
RangeCandleDown = bodyLow
r=50
g=150
b=250
elsif(open>=close and close < EMAH and close > EMAL) then
RangeWickUp = low
RangeCandleUp = bodyLow
RangeWickDown = high
RangeCandleDown = bodyHigh
r=50
g=0
b=150
endif
//bullish candlesticks
if close>EMAH then
DRAWCANDLE(LongCandleDown,LongWickUp,LongWickDown,LongCandleUp) coloured(r,g,b)
endif
//bearish candlesticks
if close<EMAL then
DRAWCANDLE(ShortCandleDown,ShortWickUp,ShortWickDown,ShortCandleUp) coloured(r,g,b)
endif
//neutral candlesticks (range)
if close<EMAH and close>EMAL then
DRAWCANDLE(RangeCandleDown,RangeWickUp,RangeWickDown,RangeCandleUp) coloured(r,g,b)
endif
RETURN EMAH coloured(0,200,100) style(dottedline) as "high EMA", EMAL coloured(255,0,0) style(dottedline) as "low EMA", EMAC coloured(0,0,255) style(dottedline) as "trend EMA", exponentialaverage[13](close) as "EMA13"
thank you zen but i am no good with the code i have no idea what to do thank you
HELLO it will not let me change the color of the candle sticks do you know how
Hello There Nicolas, When i try to copy the code i get an Error says: the following variable is not defined - EMAperiod, mmTYPE Can you help me or anyone :) thanks. PROBLEM SOLVED Thanks!!