Pine Script (TradingView)
هذا مثال Pine Script على TradingView لهذا المؤشر. الصقه في Pine Editor داخل TradingView، اضفه الى الرسم البياني، ثم عدل الاعدادات حسب السوق والاطار الزمني.
//@version=6
indicator("Vortex Indicator", overlay=false)
length = input.int(14, "Length")
tr = ta.tr
vmPlus = math.abs(high - low[1])
vmMinus = math.abs(low - high[1])
viPlus = math.sum(vmPlus, length) / math.sum(tr, length)
viMinus = math.sum(vmMinus, length) / math.sum(tr, length)
longSignal = ta.crossover(viPlus, viMinus)
shortSignal = ta.crossunder(viPlus, viMinus)
plotshape(longSignal, style=shape.triangleup, location=location.bottom, color=color.green, size=size.small)
plotshape(shortSignal, style=shape.triangledown, location=location.top, color=color.red, size=size.small)
hline(1, "1.0", color=color.gray, linestyle=hline.style_dotted)
plot(viPlus, "VI+", color=color.green)
plot(viMinus, "VI-", color=color.red)