//version=4
study(title="VWAP and 9 EMA Cross Signals", overlay=true)
// Inputs
length = input(title="Length", type=input.integer, defval=9)
// VWAP Calculation
vwapSource = hlc3
vwapPeriod = input(title="VWAP Period", type=input.integer, defval=20)
vwap = vwma(vwapSource, vwapPeriod)
// EMA Calculation
ema = ema(close, length)
// Plot VWAP and EMA
plot(vwap, color=color.blue, linewidth=2, title="VWAP")
plot(ema, color=color.green, linewidth=2, title="EMA")
// VWAP and EMA Cross Signals
longCondition = crossover(ema, vwap)
shortCondition = crossunder(ema, vwap)
// Plot Signals
plotshape(longCondition, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small, title="Long Signal")
plotshape(shortCondition, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small, title="Short Signal")
study(title="VWAP and 9 EMA Cross Signals", overlay=true)
// Inputs
length = input(title="Length", type=input.integer, defval=9)
// VWAP Calculation
vwapSource = hlc3
vwapPeriod = input(title="VWAP Period", type=input.integer, defval=20)
vwap = vwma(vwapSource, vwapPeriod)
// EMA Calculation
ema = ema(close, length)
// Plot VWAP and EMA
plot(vwap, color=color.blue, linewidth=2, title="VWAP")
plot(ema, color=color.green, linewidth=2, title="EMA")
// VWAP and EMA Cross Signals
longCondition = crossover(ema, vwap)
shortCondition = crossunder(ema, vwap)
// Plot Signals
plotshape(longCondition, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small, title="Long Signal")
plotshape(shortCondition, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small, title="Short Signal")
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.