TradingView
e2e4mfck
Sep 13, 2019 9:48 PM

[e2] Color Gradient Function 

Gold FuturesCOMEX

描述

20 step red/green gradient function

The color gradient function allow colorize any source in 5% steps.
Define the source, minimum and maximum value (constant or , for example, bb (or any other channel)).

版本注释

Added the bollinger bands on top of rsi to use the bands as the gradient's min and max values.

Added color themes: Red and Green, Red and Blue, Blue and White, Rainbow

版本注释

Color theme code hidden inside the function.
So now you can use the same function to colorize multiple plots and flip (or not) the gradient separately for every function call.
f_col_grad ( source, min_source, max_source, color_theme , color_flip ).

版本注释

- Code clean up

版本注释

Major update:
- Color gradient moved into array
- 3 additional gradients
- Indicator inputs hardcoded
- Code refactor

版本注释

.
评论
Anderson-FX
Awesome Update !!!! :)
djmad
Thank you, this is looking really really good framework for gradients
scarf
This is dynamite!
LucF
Elegance, simplicity, beauty and power. Love it!
WyckoffMode
Awesome!

; )
e2e4mfck
@WyckoffMode, Thanks )
jsiv95
Hello, Thanks for the contribution!

I have issues with the indicator, my upper chart does not have the gradient colors. Any clues where it could come from ? thanks!
KasikaBoss
@jsiv95, Go to the indicator settings and check ''colorize bars''. Hope that helps.
rimko
Thanks a lot !!!

Just a small thing, if _minSrc == _src then f_colGrad() give "na".

To work around i have modify the line 56 like that:
f_in(_min, _src, _max) => (_min <= _src) and (_src <= _max)
e2e4mfck
@rimko, Hi, thanks for pointing this out! Missed that bug. Your solution will work, but I will try to avoid "double equal" reading even if the first conditional won't trigger the next one.
You can also change the first condition in line 88: "_src < _min" to "_src <= _min" to fix that.
更多