VHF {TTR} | R Documentation |
The Vertical Horizontal Filter (VHF) attempts to identify starting and ending trends. Developed by Adam White.
VHF(price, n=28)
price |
Object able to be coerced to a matrix, which contains either a Close price series, or a High-Low-Close price series. |
n |
Number of periods to use. |
The VHF is calculated by subtracting the n
-period lowest low from the
n
-period highest high and dividing that result by the n
-period rolling
sum of the close price changes.
A vector containing the VHF values.
If Close prices are given, the function calculates the max/min using only those prices (the default). If HLC prices are given, the function calculates the max/min using the high/low prices (added for flexibility).
Josh Ulrich
The following site(s) were used to code/document this indicator:
http://www.fmlabs.com/reference/VHF.htm
http://www.equis.com/Customer/Resources/TAAZ?c=3&p=119
See aroon
, CCI
, ADX
, TDI
for other indicators that measure trend direction/strength.
data(ttrc) vhf.close <- VHF(ttrc[,"Close"]) vhf.hilow <- VHF(ttrc[,c("High","Low","Close")])