Types
color
Keyword used to explicitly declare the "color" type of a variable or a parameter.
Example
indicator("Color Keyword Example", overlay=true)
// Define custom colors using `color` keyword
color bullishColor = color.green
color bearishColor = color.red
color neutralColor = color.gray
// Check conditions
isBullish = close > open
isBearish = close < open
// Assign colors based on conditions
color barColor = isBullish ? bullishColor : isBearish ? bearishColor : neutralColor
// Apply color to bars
barcolor(barColor)