Page 1 of 1

Vertical Horizontal Filter (VHF)

Posted: 11 Feb 2011
by Laurent
My code for the VHF indicator.

The description can be found here:
http://www.incrediblecharts.com/indicat ... filter.php

Code: Select all


// VHF - Vertical Horizontal Filter - Function

Inputs:
Series ( NumericSeries ), // Close
Len ( NumericSimple );

Variables:
j ( 0 ),
Num ( 0 ),
Denom ( 0 );

Num = Highest(Series, Len) - Lowest(Series, Len);

Denom = 0;
for j = 0 to Len - 1
begin
Denom = Denom + absvalue(Series[j] - Series[j + 1]);
end;

if Denom <> 0 then
VHF = Num / Denom
else
VHF = 0;

Code: Select all

// VHF - Vertical Horizontal Filter - Indicator

Inputs:
ClosePrice ( Close ),
Length ( 28 ),
Displace ( 0 );

Variables:
MyVHF ( 0 );

MyVHF = VHF(ClosePrice, Length);

Plot1[Displace](MyVHF, "VHF");
;)