//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")
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.