Colors

Names, #hex, up and down, and colors that change per bar.

For AI tools: this page as Markdown · the whole language in one file

  • Names: green, red, blue, orange, purple, yellow, teal, pink, grey, white, aqua, lime, fuchsia, maroon, navy, olive, silver, black.
  • #rrggbb, or #rrggbbaa with transparency (#26a69a40 is a quarter solid).
  • up and down are your candle colors, so they follow your theme.
  • A color may be a formula, picking one per bar: color = x > 0 ? up : down.
  • Every plotted color is also a setting on the Style tab.
1name("Colored", where = chart)2 3fast = ema(close, 9)4slow = ema(close, 21)5plot(fast, color = fast > slow ? #00ff00 : #ff0000)6plot(slow, color = fast > slow ? #00ff00 : #ff0000)7fill(fast, slow, color = fast > slow ? #00ff00 : #ff0000, opacity = 30)8bar_color(fast > slow ? up : down)

See also: fill, bar_color, background