Pine Script Colour Input

Viewed 202

using below code in pine script, the style input is Color 0 and Color 1. How do I change the name of Color 0 to "Bull Candle" and Color 1 to "Bear Candle"?

plotcandle(open, high, low, close, title='candle', color=(open < close) ? green : red, wickcolor=gray)

Image attached for reference

1 Answers

Modifying title of inputs on Style tab is unavailable. Instead of you can use input type color with defined title, like this:

//@version=4
study("Input colors")
c1 = input(type=input.color, defval = color.green, title="Bull Candle")
c2 = input(type=input.color, defval = color.red, title="Bear Candle")
plotcandle(open, high, low, close, title='candle', color=(open < close) ? c1 : c2, wickcolor=color.gray)
Related