indicator · own pane · open source

Vortex Oscillator

Deepwick · @deepwickv1Updated 2 Oct 2026▲ 0 users
Running…
Loading chart…

About

Vortex Oscillator plots +VI and -VI — sums of upward vs downward range moves normalised by true range. When +VI crosses -VI up, the trend is bullish; the opposite for bearish.

  • Crossover of the two VIs is the entry signal.
  • Raise Length for steadier trend calls.
  • Pair with an ADX filter to confirm trend strength.

Source code

//@version=5
indicator("Vortex Oscillator", overlay=false)
len = input.int(14, "Length", minval=2, maxval=200)
tr_ = math.max(high, close[1]) - math.min(low, close[1])
vip = math.abs(high - math.max(close[1], close[2])) / math.sum(tr_, len)
vim = math.abs(low - math.min(close[1], close[2])) / math.sum(tr_, len)
hline(1, "Balance", color=color.gray, linestyle=hline.style_dotted)
p__VI = plot(vip, "+VI", color=color.green, linewidth=2)
p__VI = plot(vim, "-VI", color=color.red, linewidth=2)
alertcondition(ta.crossover(vip, vim), "+VI crosses -VI up", "Vortex turned bullish")
alertcondition(ta.crossunder(vip, vim), "+VI crosses -VI down", "Vortex turned bearish")

Comments

No comments yet.

Sign in to comment.