Vortex indicator
All indicators

LibraryTrend

Indicator

Vortex indicator

Botes and Siepman's vortex indicator: two lines that compare upward with downward price movement to catch the start of a trend.

TrendOwn pane1 inputVI

How it is calculated

VI+ is the sum of |high minus previous low| over length bars divided by the sum of the true range over the same bars; VI- uses |low minus previous high|. The first bar has no previous bar, so the first value is on bar length, counting from 0. While the true range sums to 0, with no movement at all, both lines have no value.

Reference: Botes and Siepman 2010

How to read it

VI+ above VI- points to an uptrend, below it to a downtrend, and the cross is the signal. Both lines swing around 1. In sideways markets they cross often, so a trend filter or a second confirmation helps.

In a strategy

Enter long when ctx.ind("vortex", length=14).plus crosses above .minus, exit on the opposite cross.

Inputs

InputTypeDefaultRange or choices
LengthlengthWhole number14min 1, max 5000

What it draws

LineDrawn as
VI+Line
VI-Line

Guide lines at 1.

Used in

No strategy template reads it yet.

OrionQuant