//@version=5
// Define the sell signal
def sellSignal():
return crossunder(close, BollingerBands(
source=close,
length=20,
window_dev=2.5,
matype="sma",
))
// Define the buy signal
def buySignal():
return crossover(close, BollingerBands(
source=close,
length=20,
window_dev=2.5,
matype="sma",
))
// Plot the sell signal with a red symbol
plot(sellSignal(), color=color.red, linewidth=2, style=plot.style_areabr)
// Plot the buy signal with a green symbol
plot(buySignal(), color=color.green, linewidth=2, style=plot.style_areabr)
i tried this code to make a indicator on trade view, which can tell me when to buy and when to sell my trade, by merging ai in my indicator