Trading View Colour
Trading View Colour
IN THIS ARTICLE:
Hexadecimal digits can look odd if you're new to them. Red, for
instance, can be defined as #FF0000 . And we get blue with #0000FF .
Those odd values have a big benefit, however: they can specify
hundreds of thousands different colours. That allows for a lot more
flexibility than TradingView's standard colours. Let's explore some
colours.
#4169E1
This code has the bgcolor() function colour the chart's background
from top to bottom. We use #1E90FF (dodger blue) for that. But we
don't colour every bar's background; only those that crossed above the
30-bar exponential moving average. Without that situation,
the na value disables the coloured background.
When we add the same script repeatedly to the same chart, its colours
change. Those shifted colours help to tell the different scripts apart.
(This applies to both hexadecimal colours and standard colours.)
# Summary
A hexadecimal colour defines a colour with 6 to 8 hexadecimal digits,
prefixed with the symbol sign ( # ). While they look odd, they make
hundreds of thousands of different colours possible. We can define
those colours in uppercase, lowercase, and mixed case.
When we add the same script to the chart repeatedly, its colours shift.
That helps to keep the different scripts apart. But is also means that
there's no guarantee that the same hexadecimal colour always looks
the same.
References
TradingView Docs (n.d.). Type system. Retrieved on August 17, 2019,
from https://www.tradingview.com/pine-script-
docs/en/v4/language/Type_system.html
Recommended
Want your trading idea developed into a script? See my TradingView programming services
See all TradingView tutorials to learn about a lot of Pine Script features
What code can see if a TradingView strategy went long, short, or flat?
Copyright © 2021 Kodify.net · Code examples 'uncopyrighted'
Programming services About Contact