Test
2024-11-16


//@version=5
indicator("Advanced Buy/Sell Signal", overlay=true)
length = input(10, "Supertrend Length")
factor = input.float(3.0, "Supertrend Factor")
  = ta.supertrend(factor, length)
rsiLength = input(14, "RSI Length")
rsi = ta.rsi(close, rsiLength)

  = ta.macd(close, 12, 26, 9)
buySignal = ta.crossover(macdLine, signalLine) and rsi < 30 and supertrendSignal == 1
sellSignal = ta.crossunder(macdLine, signalLine) and rsi > 70 and supertrendSignal == -1
plotshape(buySignal, style=shape.labelup, color=color.new(color.green, 0), location=location.belowbar, size=size.small, title="Buy Signal")
plotshape(sellSignal, style=shape.labeldown, color=color.new(color.red, 0), location=location.abovebar, size=size.small, title="Sell Signal")
plot(supertrendLine, color=color.blue, title="Supertrend Line")
