Vertical Horizontal Filter: Spotting Trends vs Ranges on Nifty
Learn the Vertical Horizontal Filter formula with trending, ranging and zero-net examples, how the lookback changes the value, and what VHF cannot tell you.
Key Takeaways
- 1.The Vertical Horizontal Filter (VHF) compares a recent closing-price range with total back-and-forth movement to describe how directly prices travelled.
- 2.It does not identify whether the trend is up or down.
- 3.A historical ratio does not predict the next regime.
- 4.No universal Nifty threshold or profitable option-selection rule is established here.
What the Vertical Horizontal Filter Actually Measures
The Vertical Horizontal Filter (VHF) divides the highest-to-lowest closing-price range by accumulated close-to-close movement over a chosen period. A higher ratio describes a more direct path; a lower ratio describes more back-and-forth movement. It does not show whether prices rose or fell.
The numerator is the range of closes, not the difference between the first and last close. A path can end where it started while still having a non-zero high-low range.
Use a consistent price series and bar interval. Historical direction and the amount of back-and-forth movement are different observations.
Where VHF comes from and the usual default
The Vertical Horizontal Filter is credited to Adam White and dates from 1991. Several indicator references place its first publication in a futures trading magazine that year, though we could not confirm the exact title. The usual default window in charting libraries is 28 periods. White is reported to have later preferred an 18-day window smoothed with a 6-day moving average. These are conventions. Your platform may use another default, so open its settings before comparing numbers.
The indicator does not give buy or sell signals. Its usual job is a pre-check: does the recent price path look like a trend or like a sideways chop? You then decide which kind of tool to look at next, if any. A reading says what the closing prices did in the window. It does not say what they will do next.
Why the value sits between 0 and 1
The top of the fraction is the highest close minus the lowest close in the window. The bottom is the total of all the individual close-to-close moves. A single path from the lowest close to the highest close cannot be longer than the sum of the steps taken to get there, so the top can never be bigger than the bottom. The ratio is therefore at most 1. It reaches 1 only when every step goes the same way, and it falls towards 0 when the steps cancel each other out.
A reading above 1 on a chart means the platform is using a different definition, or the data has an error. Check both before you trust the number.
The VHF Formula, Written Out Plainly
The closing-price version used here divides the range of closes by total absolute changes. Absolute means count the size of each change without its positive or negative sign. Check each platform's price inputs and calculation definition before comparing readings.
- Numerator: highest close minus lowest close over the selected period.
- Denominator: sum of absolute changes for that many intervals, including the change from the close immediately before the window.
- Divide range by total absolute change. If the denominator is zero, the ratio is not mathematically defined; check how your chart handles it.
The prior close matters. A window of ten closes needs an earlier close to calculate ten changes under the cited Tulip convention. Different boundary handling can give a different result.
Illustrative Directional-Sequence Calculation
The following ten closes are made up. Assume the close immediately before the window is also 19,650, so the first included change is zero. This keeps the sample consistent with the cited period convention.
| Day | Nifty Close | Daily change |Close minus prior close| |
|---|---|---|
| 1 | 19,650 | 0 (prior close also 19,650) |
| 2 | 19,720 | 70 |
| 3 | 19,710 | 10 |
| 4 | 19,805 | 95 |
| 5 | 19,880 | 75 |
| 6 | 19,860 | 20 |
| 7 | 19,945 | 85 |
| 8 | 20,010 | 65 |
| 9 | 20,060 | 50 |
| 10 | 20,130 | 70 |
Example range is 20,130 - 19,650 = 480. Absolute changes sum to 0 + 70 + 10 + 95 + 75 + 20 + 85 + 65 + 50 + 70 = 540. VHF is 480 / 540 = about 0.89. This describes the assumed sequence, without forecasting the next move.
Before comparing platform readings, match the lookback, source and treatment of the close just before the window. Rounding the display does not change the underlying sample.
The Same Maths in a Ranging Sample
The second made-up sample moves back and forth. Assume its prior close is also 19,500, making the first included change zero.
| Day | Nifty Close | Daily change |Close minus prior close| |
|---|---|---|
| 1 | 19,500 | 0 (prior close also 19,500) |
| 2 | 19,580 | 80 |
| 3 | 19,490 | 90 |
| 4 | 19,560 | 70 |
| 5 | 19,470 | 90 |
| 6 | 19,540 | 70 |
| 7 | 19,460 | 80 |
| 8 | 19,530 | 70 |
| 9 | 19,455 | 75 |
| 10 | 19,510 | 55 |
The example range is 19,580 - 19,455 = 125. Absolute changes sum to 0 + 80 + 90 + 70 + 90 + 70 + 80 + 70 + 75 + 55 = 680. VHF is 125 / 680 = about 0.18. The larger path and smaller range explain the lower ratio; they do not establish that selling options would profit.
A third sample: a path that ends where it started
The numerator is the highest close minus the lowest close, not the net move. To see the difference, take a short made-up four-close sample. Assume the close just before the window is 20,000, and the four closes are 20,100, 20,000, 19,900 and 20,000. The last close equals the starting close, so the net move is zero.
| Day | Close | Close minus prior close |
|---|---|---|
| Prior | 20,000 | Not counted |
| 1 | 20,100 | 100 |
| 2 | 20,000 | 100 |
| 3 | 19,900 | 100 |
| 4 | 20,000 | 100 |
The range of closes is 20,100 − 19,900 = 200. The total of the absolute changes is 100 + 100 + 100 + 100 = 400. VHF is 200 ÷ 400 = 0.50. A reading of 0.50 does not mean the market went somewhere. It means that, within the window, the highest and lowest closes were half the total distance travelled. Use the price chart as well, since the single number hides the shape of the path.
How the lookback changes the reading
Take the ten-close directional sample above. The ratio for the full ten closes is about 0.89. Now use only the last five closes (days 6 to 10), with day 5's close of 19,880 as the prior close. The closes are 19,860, 19,945, 20,010, 20,060 and 20,130. The range is 20,130 − 19,860 = 270. The absolute changes are 20, 85, 65, 50 and 70, which total 290. VHF is 270 ÷ 290, about 0.93.
The first five closes (days 1 to 5), with a prior close of 19,650, give a range of 19,880 − 19,650 = 230 and changes of 0, 70, 10, 95 and 75 that total 250, so VHF is 230 ÷ 250 = 0.92. The sample is the same, but the numbers differ by window. This is why you must write down the lookback in your rules, and why a comparison with someone else's chart needs the same setting.
| Window | Range of closes | Sum of absolute changes | VHF |
|---|---|---|---|
| Days 1 to 10 | 480 | 540 | 0.89 |
| Days 1 to 5 | 230 | 250 | 0.92 |
| Days 6 to 10 | 270 | 290 | 0.93 |
Why a Universal Threshold Is Unproven
A change in VHF records a change in the rolling sample. It can result from a new price move or an old observation leaving the window. It cannot establish that a new trend is about to begin or an existing one is exhausted.
Why VHF Alone Cannot Select an Options Trade
Option prices depend on premium, time, implied volatility and payoff structure. A low historical VHF does not guarantee a future range, and a high VHF does not guarantee a move large enough to cover a bought premium.
A daily ratio cannot describe every intraday change. NSE retains weekly options on Nifty; Bank Nifty offers monthly and quarterly options. Check the actual contract rather than assuming all indices have weekly expiries.
Costs and Tax Records for VHF-Based Rules
From 1 April 2026, option-sale STT is 0.15% of premium. Include brokerage and all other applicable charges when evaluating a rule. Income-tax reporting requires separate checks with a qualified adviser.
Combining VHF With Direction Tools
A rising and falling sequence can produce the same unsigned ratio. Read price direction separately. An additional indicator does not automatically provide independent evidence or establish a profitable entry.
Same ratio, opposite direction
Reverse the order of the ten-close directional sample so prices fall from 20,130 to 19,650, with the same size of steps. The range of closes and the total of the changes do not change, so VHF stays at about 0.89. The indicator cannot tell a rise from a fall. To read direction, use the price itself, a trendline or a moving average, and treat VHF only as a measure of how direct the move was. The how to identify a trend and trendline pages cover direction.
Some traders compare VHF with other trend-strength tools. Different tools use different inputs, so their readings need not agree. If two tools disagree, that is a reason to look at the chart and not a reason to average them. See how to trade trending markets and how to use the Supertrend indicator for other approaches, and volatility for a related but different idea.
Settings, Timeframes, and Common Mistakes
Lookback means the number of periods included. Choose it and the chart interval before comparing results. Changing either changes the sample being measured; this page establishes no preferred period for Nifty, Bank Nifty or intraday trading.
- Do not treat VHF as direction or a probability.
- Match period and prior-close handling before comparing platforms.
- Record the ratio available at the decision time.
- Include losing trades and costs when evaluating any filter.
Related reading: volatility, trendlines, costs.
Recording VHF readings in a trading journal
OneTradeJournal does not provide market data or charts. You calculate or read VHF on your own charting platform and type what you saw into the trade notes. Each trade can also hold the strategy, stop, target, emotions and mistakes, which lets you see whether VHF was part of the plan you followed.
- Write the lookback and the bar interval with the reading (for example, "VHF 28, daily").
- Write the reading you saw at the decision time, not the one you see later.
- Record trades taken when VHF was low as well as high, so the sample is not one-sided.
- After a set of trades, filter by strategy and compare outcomes. Keep in mind that a small sample proves little.
The reports show win rate, profit factor and drawdown by strategy, so you can compare a VHF-filtered rule with the same rule without the filter. The AI features are paid and can be wrong, so check any pattern against your own records.
Sources
- VHF formula and rolling-window convention (checked October 2026)
- Discontinuation of selected weekly index options (checked October 2026)
- Bank Nifty contract specifications (checked October 2026)
- STT rates effective 1 April 2026 (checked October 2026)
Related Topics
Related Articles
Understanding Rights Issue in Indian Markets
What a rights issue is, how it works in India, how it affects the share price, a worked example, rights vs bonus issue, and mistakes shareholders make.
Understanding Stock Market Indices in Indian Markets
Learn what a stock market index is, how indices like Nifty 50 and Sensex are built, SEBI's role, and how traders use an index without common mistakes.
RSI 2 Period Strategy for Indian Markets
The RSI(2) mean reversion strategy for Indian markets: 200 DMA filter, exact entry and exit rules, and worked Reliance and Bank Nifty rupee examples.
Understanding Trading Psychology in Indian Markets
Learn trading psychology for Indian markets with a worked Nifty options example showing how fear and greed turned a Rs 3,120 loss into Rs 14,300.
Understanding Short Selling in Indian Markets
How short selling works in India: the intraday-only retail rule, SEBI SLB overnight borrowing with a real Reliance borrow-cost example, F&O shorts and tax.
How to Rebalance Your Portfolio in Indian Markets
How to rebalance your Indian portfolio with the correct post-2024 tax: 20% STCG, 12.5% LTCG above Rs 1.25 lakh, plus a worked Nifty example.
The trading journal for Nifty, Bank Nifty and Indian F&O. Track your trades, spot patterns, build discipline.
- Log one trade a day by hand, on purpose
- AI mentor finds your repeat mistakes
- Behavioural analytics catch tilt early
- Trading calendar with P&L heatmap
- Pre-trade checklist flags risks
Yearly ₹3,499 · No broker credentials