OPEN-SOURCE SCRIPT

VWAP + OBV + MACD Custom Indicator

79
//version=5
indicator("VWAP + OBV + MACD Custom Indicator", overlay=true)

// 1️⃣ VWAP Calculation
vwap_value = ta.vwap

// 2️⃣ OBV Calculation
obv_value = ta.obv

// 3️⃣ MACD Calculation
[macd_line, signal_line, _] = ta.macd(close, 12, 26, 9)

// 🎯 **Buy Signal Conditions**
buy_signal = close > vwap_value and ta.change(obv_value) > 0 and macd_line > signal_line

// 🎯 **Sell Signal Conditions**
sell_signal = close < vwap_value and ta.change(obv_value) < 0 and macd_line < signal_line

// 📊 Plot VWAP
plot(vwap_value, title="VWAP", color=color.blue, linewidth=2)

// ✅ Plot Buy Signal
plotshape(buy_signal, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY")

// ❌ Plot Sell Signal
plotshape(sell_signal, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL")

// 🔔 **Alerts for Buy/Sell Signals**
alertcondition(buy_signal, title="Buy Alert", message="Buy Signal Triggered!")
alertcondition(sell_signal, title="Sell Alert", message="Sell Signal Triggered!")

כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.