OPEN-SOURCE SCRIPT

AI-Powered Buy/Sell Tool

By AhsanNader
//version=5
indicator("AI-Powered Buy/Sell Tool", overlay=true)

// RSI Setup
rsiLength = 14
rsi = ta.rsi(close, rsiLength)

// MACD Setup
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)

// Moving Averages Setup
emaShort = ta.ema(close, 20) // 20-period EMA
smaLong = ta.sma(close, 50) // 50-period SMA

// Sentiment-based volume proxy (volume spikes compared to moving average)
volChange = volume > ta.sma(volume, 50) ? 1 : 0 // If volume is above the 50-period average

// Buy/Sell Signals Logic
buySignal = ta.crossover(macdLine, signalLine) and rsi < 30 and close > emaShort and volChange == 1
sellSignal = ta.crossunder(macdLine, signalLine) and rsi > 70 and close < emaShort and volChange == 1

// Plot Buy/Sell Signals
plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")

// Plot EMA and SMA for trend visualization
plot(emaShort, color=color.blue, linewidth=2, title="EMA 20")
plot(smaLong, color=color.orange, linewidth=2, title="SMA 50")
Candlestick analysisChart patterns

نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الرمز في المنشور يخضع لقواعد‎‎قوانين الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟

إخلاء المسؤولية