Renko bars with wicks on price chart

Category: Indicators By: Nicolas Created: May 22, 2017, 3:19 PM
May 22, 2017, 3:19 PM
Indicators
37 Comments

The renko candlesticks style of prorealtime platform does not have wicks. Someone asked me to create a customized indicator to draw them. Because it is not possible to draw candlesticks on a non time dependent chart in the platform and because the renko bricks of prorealtime are “repainting”, this indicator must be applied on a “normal” chart, on any timeframe. It can be overlaid directly on the price or displayed in a window below it.

This indicator complete the other renko boxes indicators already available in the library, posted while ago:

https://www.prorealcode.com/prorealtime-indicators/renko-boxes-on-price-chart/

https://www.prorealcode.com/prorealtime-indicators/median-renko-boxes-on-price/

The renko boxes size can be modified in the indicator settings. I introduced parameters to change their designs : transparency (alpha of the candlesticks) and the wicks sizes (how much bars in width the wicks will be displayed).

The tails/wicks of a Renko candlestick represent the high and low prices achieved in each bar, just like in any other timeframe. But these highs and lows are not enough consequent to draw new a renko bar. Please note, that they are only drawn after a new brick is displayed because it uses rectangle graphical component introduced in the 10.3 version, that can’t be erased afterwards.

 

//PRC_Renko Bricks with Wicks | indicator
//22.05.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge

//---settings
//boxsize=20 //renko bricks size in points/pips
//transparency=50 //brick colours alpha
//wicksize=1 //width of wicks
//---end of settings

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

//saving current high/low
highwick=max(high,highwick)
lowwick=min(low,lowwick)

//compute wicks at each new contrarian brick
if r>0 and r[1]=0 then
 //new red brick
 drawrectangle(wickbar,highwick,wickbar+wicksize,upbox[1]) coloured(r[1],g[1],0)
 lowwick=low*100
 highwick=0
endif
if r=0 and r[1]>0 then
 //new green brick
 drawrectangle(wickbar,lowwick,wickbar+wicksize,downbox[1]) coloured(r[1],g[1],0)
 lowwick=low*100
 highwick=0
endif
//compute wicks at each new same brick
if r>0 and r[1]>0 and lastdrawn<>wickbar then
 //new red brick
 if highwick>upbox[1] then
  drawrectangle(wickbar,highwick,wickbar+wicksize,upbox[1]) coloured(r[1],g[1],0)
 endif
 lastdrawn=wickbar
 lowwick=low*100
 highwick=0
endif
if r=0 and r[1]=0 and lastdrawn<>wickbar then
 //new green brick
 if lowwick<downbox[1] then
  drawrectangle(wickbar,lowwick,wickbar+wicksize,downbox[1]) coloured(r[1],g[1],0)
 endif
 lastdrawn=wickbar
 lowwick=low*100
 highwick=0
endif

//draw renko candlesticks
drawcandle(upbox,upbox,downbox,downbox)coloured(r,g,0,min(transparency,255))

RETURN

 

Download
Filename: PRC_Renko-bricks-with-wicks.itf
Downloads: 651
Download
Filename: renko-with-wicks-indicator.png
Downloads: 143
Download
Filename: renko-bricks-with-wicks-prorealtime.png
Downloads: 196
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...