[RS]Renko ZigZag V0

Renko based zigzag:
  • mode: can be Traditional or ATR.
  • modeValue: can be whole number if you use ATR mode, or floating point number in case of Traditional mode.
  • showOverlay: displays basis Renko overlay.
Remove from Favorite Scripts Add to Favorite Scripts
study("[RS]Renko ZigZag V0", shorttitle="[RS]RZ.V0", overlay=true)
mode = input('ATR')
modeValue = input(14.000, type=float)
bricksize = mode == 'ATR' ? atr(round(modeValue)) : mode == 'Traditional' ? modeValue : na
showOverlay = input(false)
propen = nz(ropen[1])
ropen = close > propen+bricksize or high > propen+bricksize ? propen+bricksize :
        close < propen-bricksize or low < propen-bricksize ? propen-bricksize : propen

rclose = ropen > propen ? ropen-bricksize : ropen < propen ? ropen+bricksize : nz(rclose[1])
direction = ropen > propen ? 1 : ropen < propen ? -1 : nz(direction[1])
rc = direction == 1 ? green : direction == -1 ? maroon : na

p00 = plot(not showOverlay ? na : ropen, style=cross, color=rc, linewidth=3)
p01 = plot(not showOverlay ? na : rclose, style=circles, color=gray, linewidth=2)

fill(p00, p01, color=gray, transp=75)

//  ||-->   ZigZag:
prev_extreme = change(direction) != 0 ? ropen : fixnan(extreme[1])
extreme = direction == 1 and high >= prev_extreme ? high : direction == -1 and low <= prev_extreme ? low : prev_extreme
plot(change(direction) != 0 ? extreme[1] : na)
Sweet. You read my mind Ricardo. This will be great as I use Renko a lot and wanted a way to overlay it on a bar chart. A++++++++++++
Nice idea, like it.
thx, next in line is gona be based on PA :p
Is there a way to backtest Renko scripts published in TradingView? I've been a fan of Renko, but new to TradingView.
Also, would be great to set up alerts on Renko reversal points
its possible, but very limited..
On this indicator Does the plot of the new high or new low get placed immediately or is it on the candle of the next time frame. If that makes any sense. ty
this does not repaint, if its what your asking?
Well i guess what I'm asking if you look at your chart example here the candle with the high wick at a price of 11750 the zig zag there looks like it is telling you it hit a new high so i guess my question is there a lag with that zig zag or does it wait till the next 5 minute candle formation? Thank you for taking the time to answer my first question
yes its lagging by atleast 1 candle bar, can vary depending on distance to extreme since the swings are based on the range block swings and then capturing pivots when it changes
Muito Bom! Thanks.
Ideas Scripts Chart
United States
United Kingdom
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