本页源码来自 TradingView 公开发布的开源脚本,版权归原作者所有, 请遵循其原始许可(Pine 脚本常见 CC BY-NC-SA / MPL-2.0 / MIT)。 本项目仅用于研究检索与许可范围内的移植。
//@version=6
indicator("Day Trade VWAP + EMA 9/20", overlay=true)
// --- Calculations ---
// VWAP
srcVwap = ta.vwap(close)
// EMAs
srcEma9 = ta.ema(close, 9)
srcEma20 = ta.ema(close, 20)
// --- Conditions ---
longCond = close > srcVwap and srcEma9 > srcEma20 and ta.crossover(close, srcEma9)
shortCond = close < srcVwap and srcEma9 < srcEma20 and ta.crossunder(close, srcEma9)
// --- Plotting Moving Averages ---
plot(srcVwap, title="VWAP", color=color.yellow, linewidth=2)
plot(srcEma9, title="EMA 9", color=color.green, linewidth=1)
plot(srcEma20, title="EMA 20", color=color.red, linewidth=1)
// --- Plotting Signals ---
plotshape(longCond, title="Long Entry", style=shape.triangleup, location=location.belowbar, color=color.lime, size=size.small)
plotshape(shortCond, title="Short Entry", style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)