//—settings
boxsize=10//8//100//8 //renko bricks size in points/pips
transparency=100 //brick colours alpha
wicksize=0 //width of wicks
//—end of settings
//EMA7=exponentialaverage [7](close)
size=boxsize*pointsize
once upbox = close
once downbox = close - size
once lowwick = close*100
IF close > upbox + size THEN
upbox = upbox + size
downbox = downbox + size
r=0
g=200
begin=barindex
highwick=close
wickbar=barindex-round((barindex-begin[1])/2)
ELSIF close < downbox - size THEN
upbox = upbox - size
downbox = downbox - size
r=200
g=0
begin=barindex
wickbar=barindex-round((barindex-begin[1])/2)
ENDIF
//draw renko candlesticks
drawcandle(upbox,upbox,downbox,downbox)coloured(r,g,0,min(transparency,255))
Mid = (upbox+downbox)/2
EMA7 = ExponentialAverage[7](Mid)
EMA20 = ExponentialAverage[20](Mid)
EMA50 = ExponentialAverage[50](Mid)
RETURN EMA7 as "EMA 7", EMA20 coloured(0,0,255) as "EMA 20", EMA50 coloured(255,0,0) as "EMA 50"