RicardoSantos

[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)
Muito Bom! Thanks.
Reply
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
Reply
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
Reply
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
Reply
this does not repaint, if its what your asking?
Reply
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
Reply
its possible, but very limited..
Reply
thx, next in line is gona be based on PA :p
Reply
Nice idea, like it.
Reply
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++++++++++++
Reply
United States
United Kingdom
India
Deutschland
España
France
Việt Nam
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
Malaysia
日本
한국
简体
繁體
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing Support Priority Support Report Issue Ideas Published Followers Following Private Messages Chat Sign Out