צאט //@version=5
indicator("Buy/Sell Signal", overlay=true)
// הגדרות לממוצע נע ול-RSI
rsiLength = 14
rsiOverbought = 70
rsiOversold = 30
maLength = 50
// חישובים
rsi = ta.rsi(close, rsiLength)
ma = ta.sma(close, maLength)
// תנאים לקנייה ולמכירה
buyCondition = rsi < rsiOversold and close > ma
sellCondition = rsi > rsiOverbought and close < ma
// סימון קנייה ומכירה על הגרף
plotshape(series=buyCondition, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal", text="Buy")
plotshape(series=sellCondition, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal", text="Sell")