TradingView
ahancock
6 de Ago de 2020 22:55

Hancock - Renko 

Ether / United States DollarCoinbase

Descrição

This is the first release of Renko indicator.

Renko is plotted over candles and best calculates the number of Renko bricks printed up or down per candle which can be viewed from the data window. It plots the high and low of a the bricks, if numerous bricks are printed on a candle, as well as the open and close of a Renko brick.

This will be actively developed and improved over the next few months and i will be basing other indicators from this Renko.

Happy trading

Hancock

Notas de Lançamento

Few fixes involved in the publish of this script:

- Improved formatting of code.
- Fixed renko brick production calculting wrong values. This is now correct when viewed in the data window for bricks up and bricks down.
- Fixed ATR and Fixed mode renko
- Fixed ATR renko not calculating brick open and close correctly. It would often have a gap between bricks on change of trend.
- Fixed ATR brick size calculation using current ATR when brick was created not using the previous brick ATR size.
- Fixed issue where renko low was not calculated properly when price is below current renko close.
- Removed duplicate data from the data window.
- Added renko candle delta's to the data window.

Next improvements:
- Add Pivot high and low based on renko for support and resistance.
- Update plots to better represent the high and low of the renko bricks when rapid brick production happens during a single candle.
- Handle inital trend_none state for renko and initialize state on the first valid renko brick. This will be useful in back-testing.
- Create a more accurate MACD and RSI based on the deconstruction of candles to renko bricks.

This might look like simple code but it has taken a little while to figure out the logic for valid renko brick production. If you appreciate the indicator thus far or find it useful drop a comment or like as it helps motivate me to continue writing scripts :)

Happy trading
Hancock

Notas de Lançamento

Fix number of blocks up and blocks down per candle plotted correctly in data window.

Notas de Lançamento

Fixes:
- Fixed issue where renko open and close not plotted correctly due to incorrect per candle brick up and down calculation. As far as i can tell there are no more issues with how renko bricks are calculated.

Future development:
- Need to fix initial state of renko trend to trend none.
- Tidy up redundant code.

Happy trading
Hancock

Notas de Lançamento

Removed completed TODO's from script.

Notas de Lançamento

Included renko percentage brick size. With Fixed sized renko selected and use percentage checked the brick size input is used as a percentage of close as fixed size.

TODO:
Round to tick nearest tick and add tick fixed size check option

Happy trading
Hancock
Comentários
Dharmesh_
Nice Brother, please write a script Renko % box with option of fix % based its missing on trading view.
ahancock
@Dharmesh_, I've included a rudimentary version of fixed brick size by percentage. I'll need to do a fix for the percentage change during rapid brick production in a single candle but this should work as a close estimate. The later requires quite a bit more work to get correct.
RajeevNaik
Thanks AH. This is the best Renko script without security function! Thanks a lot of the same. Just added "plotcandle(renko_open, renko_high, renko_low, renko_close, color = renko_open < renko_close ? color.lime : color.red)" .
fercatico
This is amazing, thanks for making it open source.
Also, do you know if there is a way to use scripts like this one on the Screener?
ahancock
@fercatico, Thanks for your kind words! I'm not sure how to get scripts on the Screener unfortunately. Might be worth asking for that as a feature request in tradingview if it's not possible. i imagine that would require a change to the pine language though.
nilux
nice man, thanks for sharing. love the visual approach of layering renko boxes over candles! cool stuff.
ahancock
@nilux, Thanks! Layering renko over candles has been done many times but with this im trying to accurately calculate how many up and down boxes were produced during a single candle which hasn't been done yet and kept open source! Hopefully these calculations will be able to produce more accurate moving averages, MACD, RSI and stochastics layered over normal candlesticks but still represented by a renko chart. Still working through some issues with the script at the moment but will release an update later today. Thanks for the interest :)
Mais