TradingView
EffyewMoney
14 de Set de 2021 10:51

EM_RSI Gradient Candles 

Tesla, Inc.NASDAQ

Descrição



I've missed the beautiful trend visualization of Heiken Ashi candles ever since I first learned they don't play well with other indicators largely due to the method with which they're plotted.

I wanted to color code a gradient onto candles to help visualize trend strength, and the Relative Strength Index was the first thing to come to mind. For coloring, it's possible the new color.from_gradient function would have worked, but I couldn't guarantee a highly customizable indicator with a single gradient so I took a more classic approach.

First, RSI was calculated using Tradingview's built-in RSI code.

Then I broke down the RSI's range of 1-100 into 10 tiers and assigned each a color option with the ability to turn any particular tier off if desired.

I found it to be extremely modular and helpful in visualizing both trend strength and identifying potential trend reversals due to a reduction in strength.

You can use it on every candle to help inform decisions, or keep all but <10 and >90 turned off so that it only changes candle color during the most extreme trends.



Or anything in between!



This is my first self-coded indicator so I'm already proud.
Please let me know what you think, and feel free to suggest improvements for future versions in the comments!

Notas de Lançamento

Reorganized code so user color options have high RSI at the top and low RSI at the bottom.

Tweaked range definitions for more precise shading.

Added RSI EMA with customizable length

Added labels signaling when RSI crosses over or under EMA

Added an option to turn labels off

Added an option to hide historic labels only

Added options to change label colors

Added color-matching wicks and borders (commented out because there's only one way to do it and it doesn't play well with others, but still an option if you enable the code)

Tweaked hues so that certain changes in tiers were more distinguishable






Notas de Lançamento

Removed drawings from top screenshot that overwrote original in last update.
Comentários
BrewLee
This stuff is amazing. <3 Great work!
cewilson617
This is such an incredibly helpful indicator for beginner technical analysis and traders. Thanks so much for sharing!
EffyewMoney
Glad I could help! I've been loving it so far. Accidentally identified some divergence on it the other day by noticing lighter shades at higher prices.
suddenCamel28673
Thanks for this.

My candles have stopped showing green and red even after resetting and reloading the add on.

Is there a way to make the candles color again?

They just show grey and white now.

Thanks
EffyewMoney
@suddenCamel28673, Hmm, the only thing that comes to mind is the check box next to each "Bar Color" under the Style tab in settings. Aside from that, there's no code that defines color. I've been slow to upgrade it to PineScript v5.0, but haven't encountered any issues in my use of it yet.
suddenCamel28673
@EffyewMoney, Thanks for the reply! I figured it out, there was another indicator that when enabled causes the candle colors to go away. When I disable it the green and red come back. All good now.
EffyewMoney
Future versions will include text labels for times when RSI crosses over or under an EMA with customizable length and the option to match wicks and/or borders to indicator-shaded candlesticks.
EffyewMoney
The features above, and more, were added in version 2.
Mais