ColourUtilitiesLibrary "ColourUtilities"
Utility functions for colour manipulation
adjust_colour(rgb, desaturation_amount, transparency_amount)
to reduce saturation or increase transparency of an RGB colour
Parameters:
rgb (color)
desaturation_amount (float) : 0 means no desaturation (colours remains as-is), and 1 means full desaturation (colour turns grey). Can also be used inversely with negative numbers
transparency_amount (float) : How much more transparent the default transparency should become. E.g. with a value of 0.5, a transparency of 0 becomes 50 and 40 becomes 70. A value of 1 makes it fully transparent, en -1 fully opaque.
Returns: color with adjusted saturation and transparency
method apply_default_palette(self, palette_name)
Some nice looking colour palettes, consisting of 6 gradient colours, are already defined here and can be quickly applied to the Palette class
Namespace types: Palette
Parameters:
self (Palette)
palette_name (string) : Currently there are 4 6-coloured palettes available: "GYTS flux signal", "GYTS purple", "GYTS flux filter" and "GYTS maroon"
Returns: None, as it populates the Palette class with pre-defined colours
method get_colour(self, colour_no, transparency)
Retrieves colour from the palette and possibly changes transparency if set
Namespace types: Palette
Parameters:
self (Palette)
colour_no (int) : from the palette
transparency (int) : to possibly change the default transparency of the palette
Returns: colour
method get_dynamic_colour(self, x, mid_point, colour_lb, colour_ub, trend_lookback, use_rate)
Retrieves a colour based on strength and direction of the passed series
Namespace types: Palette
Parameters:
self (Palette)
x (float) : the input data series
mid_point (float) : value as a cutoff point where the bullish/bearish colour scenario
colour_lb (float) : value (lower bound) where to apply the bearish colour at full strength
colour_ub (float) : value (upper bound) where to apply the bullish colour at full strength
trend_lookback (int) : how much bars back to check if there was a consistent move into a certain direction, otherwise a the neutral colour from the centre of the palette will be used.
use_rate (bool) : whether to use the rate (proportional difference with previous `x` value) or the input series `x` directly
Returns: colour
Palette
Fields:
transparency (series__integer)
palette (array__color)
Colour
Volume Candlesticks [cajole]
This script lets you create the equivalent of "volume candlesticks" in TradingView.
"Volume candlesticks" normally vary their width according to the bar's volume. This script varies COLOUR instead of WIDTH.
Bar charts are also supported.
Candles/Bars are coloured by their distance from the average volume. You can also add a "huge volume" colour to further highlight the most extremely-high volume bars.
Note that volume is extrapolated for incomplete bars by default. So, if the average volume of the past 10 days is 5M shares, and 5M shares trade in the first 10% of today's session, that bar will be coloured as though 50M shares have traded. Set the "Extrapolate" option to 1.0 to disable this.
For this script to work properly, you should set TradingView's default candle/bar colours to be at least 20% transparent. By default, TradingView tends to overlay its own bars on top of indicators.
Nerdy details:
The script works best on a dark background, because it is easier to change the hue of white bars than of black bars. If you find a set of colours that work for white backgrounds, please comment with them!
The geometric mean is used instead of the arithmetic mean, to keep the 'average' from being strongly influenced by spikes. Bars are
then coloured by assuming a normal probability distribution and highlighting outliers. (This means that the first high-volume bars are coloured differently to later ones.)
RSI mid partition color changeWhen RSI is above 50 our default bias is on buy side and when below 50 our bias is on sell side.
Therefore created 2 zones for easy identification.
Percent above or Below Moving Average Candle colourFilter:
If green candle is 'x' % above moving average than colour of candle is turn in blue colour.
If red candle is 'x' % below moving average than colour of candle is turn in orange colour.
RSI - colour fillThis script showcases the new (overload) feature regarding the fill() function! 🥳
2 plots could be filled before, but with just 1 colour per bar, now the colour can be a gradient type.
In this example we have 2 plots
- rsiPlot , which plots the rsi value
- centerPlot, which plots the value 50 ('centre line')
Explanation of colour fill in the zone 50-80
Default when rsi > 50
- a bottom value is set at 50 (associated with colour aqua)
- and a top value is set at 80 (associated with colour red)
This zone (bottom -> top value) is filled with a gradient colour (50 - aqua -> 80 - red)
When rsi is towards 80, you see a red coloured zone at the rsi value,
while when rsi is around 50, you'll only see the colour aqua
The same principle is applied in the zone 20-50 when rsi < 50
Cheers!
Educational: FillThis script showcases the latest feature of colour fill between lines with gradient
There are 17 ema's, all with adjustable lengths.
In the settings there are 3 options: '1' , '2' , and '1 & 2' :
Option '1'
Here the highest - lowest lines are filled with a gradient colour,
dependable where the 3rd highest/lowest ema is situated in regard of these 2 lines:
Option '2'
Here the colour fill is applied between every ema and the one next to it.
The gradient colour is dependable where the ema is situated in regard of the highest - lowest line:
Option '1 & 2'
A combination of both options:
The setting 'switch colours at ema x' regulates the switch between bullish and bearish colours.
When close is above the chosen ema -> bullish colours, when below -> bearish colours.
Examples of other settings of 'switch colours at ema x' :
Colour switch when close above/below:
ema 14
ema 11
ema 8
ema 5
ema 2
The colours can be set below, both for option '1' and '2'
Cheers!
Moving Average Slope AnalysisThis is a simple script which allows to do slope analysis on any kind of Moving Average. Simply change the moving average function that you wish to work with , in the script.
Slope analysis may be required for fine-tuning trade automation software , which uses Moving Average for determining optimum enter/exit point.
Read code comments for instructions!
RSI Colour OverlayApplies Blue or Pink colour overlay to candles when RSI is at or over the predefined parameters. These parameters are adjustable in the settings area of the indicator. Please note RSI does not guaranteed a pivot point in price action and the colour overlay should only be used as an indication or condition not a call to buy or sell alone. The colour overlay is a useful prompt to review price action. I hope this helps and good luck with your analysis and trading.
asw EMA trend colouredema50 and ema 200 =
blue and green shows uptrend
red and orange shows downtrend
highlighted 'golden cross' =
green shows uptrend started
red shows downtrend started
BBand width bgcolorSimple backround colouring based upon input criteria.
Published by request of a TV user.
Sorry if this is duplicate, but I couldn't see any other scripts on TV.
RSI TrendspotterHad a bit of a TA epiphany with RSI so bear with me. The time since RSI was last overbought/sold is a solid trend indicator. This may seem obvious but after x number of years trading it hit me like a smack in the face. I've coded this for easy visualisation. They're fairly simple changes but it's making a big difference in my trendspotting already.
In the example CMG hasn't been overbought for 183 days, so the RSI is mostly green:
Before that it hadn't been oversold for 199 days, so RSI is mostly red:
And before that it was ranging like a maf*ckin' sine wave, so the RSI shows green, red, green, red, etc.:
Finally, normal RSI for comparison. Same data, but now with pretty colours:
I've also added overbought/oversold highlights cause that just makes the whole charting thing a lot easier. Enjoy!
Colored EMAThis is a modified version of the exponential moving average indicator to change color based on trend (red/bearish if price has closed below EMA, green/bullish if price has closed above EMA).
Fisher Transform with Up/Down colours - squattterCredit to HPotter - colour code borrowed from his AO script.