OPEN-SOURCE SCRIPT

Abdulelah Eid

//version=5
strategy("VWAP and MA Strategy with Volume Confirmation - Customizable", overlay=true)

// إعدادات VWAP
vwapSource = input.source(title="VWAP Source", defval=hlc3)

// إعدادات المتوسطات المتحركة
ma20Length = input.int(title="MA20 Length", defval=20)
ma50Length = input.int(title="MA50 Length", defval=50)

// إعدادات حجم التداول
volumeMultiplier = input.float(title="Volume Multiplier", defval=1.5)

// حساب VWAP
vwap = ta.vwap(vwapSource, volume)

// حساب المتوسطات المتحركة
ma20 = ta.sma(close, ma20Length)
ma50 = ta.sma(close, ma50Length)

// شروط الشراء
longCondition = close > vwap and ma20 > ma50 and volume > ta.sma(volume, 20) * volumeMultiplier

// شروط البيع
shortCondition = close < vwap and ma20 < ma50 and volume > ta.sma(volume, 20) * volumeMultiplier

// رسم VWAP والمتوسطات المتحركة
plot(vwap, color=color.blue, title="VWAP")
plot(ma20, color=color.red, title="MA20")
plot(ma50, color=color.green, title="MA50")

// رسم إشارات الدخول والخروج (باستخدام plotchar)
plotchar(longCondition, char="كول", location=location.belowbar, color=color.green, size=size.small, title="Buy Signal")
plotchar(shortCondition, char="بوت", location=location.abovebar, color=color.red, size=size.small, title="Sell Signal")

// أوامر الدخول والخروج (اختياري)
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
Bands and ChannelsBill Williams IndicatorsBreadth Indicators

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer