Appearance
chart
How does a script know what kind of chart it runs on? On TradingView it reads chart.*. Here every chart is a standard bar or candle chart, so these values are the same on every run, and a script that checks them still runs as it should.
pine
//@version=6
indicator("Doji, on real candles only", overlay = true)
// a Heikin Ashi bar's open isn't a traded price, so check the chart's type first
doji = chart.is_standard and math.abs(close - open) <= (high - low) * 0.1
plotshape(doji, "Doji", shape.cross, location.abovebar, color.gray)For a drawing's anchor, see chart.point.
chart.bg_color
pine
input color chart.bg_colorThe chart's background colour, #0F1623.
It stays the same in every theme of the terminal, so it doesn't match a light theme's background.
chart.fg_color
pine
input color chart.fg_colorThe colour of the chart's text, #E2E8F0.
Like chart.bg_color, it stays the same in every theme, so text drawn in it is hard to read on a light theme.
chart.is_standard
pine
simple bool chart.is_standardAlways true here: every chart is a standard bar or candle chart.
chart.is_*
No effect here
The other chart types: Heikin Ashi, Kagi, Line Break, Point & Figure, range and Renko. Each is always false here.
Each is a simple bool.
chart.left_visible_bar_time
Pine v6No effect here
pine
input int chart.left_visible_bar_timeAlways 0 here, not the time of the leftmost bar in view. A test such as time >= chart.left_visible_bar_time holds on every bar.
chart.right_visible_bar_time
Pine v6No effect here
pine
input int chart.right_visible_bar_timeAlways 0 here, not the time of the rightmost bar in view.