Mehrdad1

Mehrdad1

//@version=5
indicator("Super Buy/Sell Indicator", overlay=true)

// تنظیمات اندیکاتور
lengthEMA = input(50, title="EMA Length")
lengthRSI = input(14, title="RSI Length")
lengthMACD = input(12, title="MACD Fast Length")

// محاسبه EMA، RSI و MACD
emaLine = ta.ema(close, lengthEMA)
rsiValue = ta.rsi(close, lengthRSI)
= ta.macd(close, lengthMACD, 26, 9)

// شرایط خرید و فروش
buyCondition = ta.crossover(rsiValue, 30) and ta.crossover(macdLine, signalLine) and close > emaLine
sellCondition = ta.crossunder(rsiValue, 70) and ta.crossunder(macdLine, signalLine) and close < emaLine

// نمایش فلش روی چارت
plotshape(buyCondition, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY")
plotshape(sellCondition, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL")

// تغییر رنگ پس‌زمینه هنگام سیگنال خرید و فروش
bgcolor(buyCondition ? color.green : sellCondition ? color.red : na, transp=90)

Read More

Share:

Latest News