OPEN-SOURCE SCRIPT
cc

/version=5
indicator("5 Min Forex Strategy", overlay=true, timeframe="5")
// ───────── Indicators ─────────
// EMAs
ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
// RSI
rsi = ta.rsi(close, 14)
// Stochastic
k = ta.stoch(close, high, low, 14)
d = ta.sma(k, 3)
// ───────── Trend Conditions ─────────
bullTrend = ema50 > ema200
bearTrend = ema50 < ema200
// ───────── Entry Conditions ─────────
// Buy when trend is bullish + RSI > 50 + Stochastic crosses up from oversold
buySignal = bullTrend and rsi > 50 and ta.crossover(k, d) and k < 20
// Sell when trend is bearish + RSI < 50 + Stochastic crosses down from overbought
sellSignal = bearTrend and rsi < 50 and ta.crossunder(k, d) and k > 80
// ───────── Plot Indicators ─────────
plot(ema50, color=color.yellow, title="EMA 50")
plot(ema200, color=color.red, title="EMA 200")
// RSI & Stoch plot on separate pane
rsiPlot = plot(rsi, "RSI", color=color.new(color.blue, 0))
hline(70); hline(30)
// ───────── Plot Buy/Sell signals ─────────
plotshape(buySignal, title="BUY", style=shape.labelup, color=color.green, text="BUY", size=size.small, location=location.belowbar)
plotshape(sellSignal, title="SELL", style=shape.labeldown, color=color.red, text="SELL", size=size.small, location=location.abovebar)
indicator("5 Min Forex Strategy", overlay=true, timeframe="5")
// ───────── Indicators ─────────
// EMAs
ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
// RSI
rsi = ta.rsi(close, 14)
// Stochastic
k = ta.stoch(close, high, low, 14)
d = ta.sma(k, 3)
// ───────── Trend Conditions ─────────
bullTrend = ema50 > ema200
bearTrend = ema50 < ema200
// ───────── Entry Conditions ─────────
// Buy when trend is bullish + RSI > 50 + Stochastic crosses up from oversold
buySignal = bullTrend and rsi > 50 and ta.crossover(k, d) and k < 20
// Sell when trend is bearish + RSI < 50 + Stochastic crosses down from overbought
sellSignal = bearTrend and rsi < 50 and ta.crossunder(k, d) and k > 80
// ───────── Plot Indicators ─────────
plot(ema50, color=color.yellow, title="EMA 50")
plot(ema200, color=color.red, title="EMA 200")
// RSI & Stoch plot on separate pane
rsiPlot = plot(rsi, "RSI", color=color.new(color.blue, 0))
hline(70); hline(30)
// ───────── Plot Buy/Sell signals ─────────
plotshape(buySignal, title="BUY", style=shape.labelup, color=color.green, text="BUY", size=size.small, location=location.belowbar)
plotshape(sellSignal, title="SELL", style=shape.labeldown, color=color.red, text="SELL", size=size.small, location=location.abovebar)
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.