Factors Directory

Quantitative Trading Factors

Vertical Horizontal Filter (VHF)

Technical Factors

factor.formula

Highest Close Price (HCP):

The maximum value of the highest price (HIGH) in the past N periods. This value represents the upper limit of the upward fluctuation of the price in a given time period.

Lowest Close Price (LCP):

The minimum value of the lowest price (LOW) in the past N periods. This value represents the lower limit of the downward fluctuation of the price in a given time period.

Absolute Price Range, A:

The absolute difference between the highest price of the highest price range (HCP) and the lowest price of the lowest price range (LCP). This value measures the maximum vertical fluctuation of the price in the specified period, that is, the total width of the price range.

Price Summation (B):

The sum of the absolute values ​​of the difference between the daily closing price (CLOSE) and the previous day's closing price over the past N periods. This value measures the magnitude of the price level change over the specified period, that is, the sum of all price changes.

Vertical Horizontal Filter (VHF):

The ratio of the total fluctuation range (A) of the price range to the total price change (B). This value reflects the dominant direction of price fluctuations, that is, whether it is trending or oscillating. The higher the VHF value, the greater the vertical component of price fluctuations, which is more inclined to trending markets; the lower the VHF value, the greater the horizontal component of price fluctuations, which is more inclined to oscillating markets.

If the denominator is zero, set it to zero:

To avoid the situation where the denominator is zero, the VHF value is set to 0 when the sum of price changes (B) is 0.

Default Period (N):

The default period used for VHF calculations, i.e. the time window used to calculate HCP, LCP, A and B. The value of N is usually 20, but can be adjusted according to different markets or trading strategies. A smaller value of N makes VHF more sensitive to short-term changes in price, and a larger value of N makes VHF more sensitive to long-term trends in price.

The VHF indicator determines the current market status by comparing the vertical fluctuation range and horizontal fluctuation range of the price in a specified period. When the price fluctuation tends to be vertical, the VHF value will increase, indicating that the market is in a trending market. When the price fluctuation tends to be horizontal, the VHF value will decrease, indicating that the market is in a volatile market. Therefore, this indicator can help investors choose appropriate trading strategies and technical indicators.

  • Highest Close Price

  • Lowest Close Price

  • Absolute Price Range

  • Price Summation

  • Default Period

factor.explanation

The vertical horizontal filter indicator (VHF) is a technical indicator used to determine whether the market is in a trending stage or a shocking stage. It makes the judgment by comparing the ratio of the vertical price fluctuation (price range) to the horizontal price fluctuation (the sum of price changes). Unlike traditional trend indicators (such as MACD) and shock indicators (such as RSI), the advantage of VHF is that it can help investors choose appropriate indicators according to different stages of the market. When the VHF value is high, it indicates that the market trend is strong and it is suitable to use trend tracking indicators; when the VHF value is low, it indicates that the market fluctuation is more shocking and it is suitable to use shock indicators. Therefore, VHF can be used as an effective market status filter to improve the robustness of trading strategies.

Related Factors