Reputation: 1094
plot(close, "Close", close > EMA200 ? color.green : color.red)
How do I add titles for the colors used if I'm using conditional colors like the code above?
On the Style tab, it just displays the colors as Color 0 and Color 1.
Upvotes: 0
Views: 456
Reputation: 14378
Don't think you can directly (at least I don't remember seeing an example of named colours on the Styles tab).
You can put conditional colour settings on the Inputs tab, eg:
col_macd = input(#2962FF, "MACD Line ", group="Color Settings", inline="MACD")
col_signal = input(#FF6D00, "Signal Line ", group="Color Settings", inline="Signal")
(the example taken from the built-in MACD indicator)
Upvotes: 1