How can I have the option for the script to show only bullish or only bearish candles?

39 views Asked by At

This indicator is just about perfect for what I'm trying to use it for. The issue is that, while cool looking, having the bearish candles plotted on the bottom of the priceline and the bullish on the opposing side makes for more manual drawing and whatnot to get the info I'm looking for. To combat this I would like to be able to select whether I want to see bullish or bearish candles. Thanks for any guidance!

//@version=5

indicator(title='Candle Size', shorttitle='CS')
src1 = input(high, title='Source 1')
src2 = input(open, title='Source 2')
src3 = input(open, title='Source 3')
src4 = input(low, title='Source 4')
cs = src1 - src2
cs2 = 0 - (src3 - src4)
linea = ta.sma(cs, 20) * ta.ema(cs, 20) / 2 / 100
linea2 = 0 - ta.sma(cs2, 20) * ta.ema(cs2, 20) / 2 / 100

plot(cs, color=color.new(color.green, 0), style=plot.style_columns, linewidth=3)
plot(cs2, color=color.new(color.red, 0), style=plot.style_columns, linewidth=3)
plot(linea, color=color.new(color.yellow, 0), linewidth=3)
plot(linea2, color=color.new(color.yellow, 0), linewidth=3)
0

There are 0 answers