The Vortex Indicator
The article by Etienne Botes and Douglas Siepman in this issue, “The Vortex Indicator”, demonstrates another reliable technical indicator for trading a change in market direction. The vortex indicator was developed as a new directional movement indicator, drawing inspiration from J. Welles Wilder’s directional movement indicator, as well as another unrelated and improved directional indicator.
Using Indicator Builder, one needs to create two indicators: Vortex Indicator Plus and Vortex Indicator Minus.
Here is the Tradecision code for the Vortex Indicator Plus:
Vortex Indicator Plus:
input
Length:"Length",14;
end_input
var
VMPlus:=0;
VMPlusS:=0;
VMTR:=0;
VMTRS:=0;
VIPlus:=0;
end_var
VMPlus:= Abs(High - Low\1\);
VMPlusS:=CumSum(VMPlus,Length);
VMTR:= Max(VMPlus, Abs(High - Close\1\),
Abs(Low - Close\1\)); VMTRS:=CumSum(VMTR,Length);
VIPlus:= VMPlusS/VMTRS;
return VIPlus;
Here is the Tradecision code for the Vortex Indicator Minus:
Vortex Indicator Minus:
input
Length:"Length",14;
end_input
var
VMPlus:=0;
VMMinus:=0;
VMMinusS:=0;
VMTR:=0;
VMTRS:=0;
VIMinus:=0;
end_var
VMPlus:= Abs(High - Low\1\);
VMMinus:=Abs(Low - High\1\);
VMMinusS:=CumSum(VMMinus,Length);
VMTR:= Max(VMPlus, Abs(High - Close\1\),
Abs(Low - Close\1\)); VMTRS:=CumSum(VMTR,Length);
VIMinus:= VMMinusS/VMTRS;
return VIMinus;
|