Ultimate Oscillator (UO) combines price-derived buying pressure and True Range over three rolling windows. This guide reconstructs the calculation on real USD/JPY H1 quotes. Its three cases use adjacent hours from the same historical episode; their chart windows overlap. They explain the calculation, not three independent trading tests.
1. Read three windows on one chart
UO measures where closes sit within ranges that also consider the previous close. It combines the last 7, 14 and 28 BP/TR terms of one series. On this H1 chart, these are three lookbacks on recorded hourly bars, not separate H1, H4 and daily charts.
The name buying pressure does not mean that we observed executed buying volume. BP and TR use high, low, close and the previous retained close. The result has no price unit and does not represent a percentage account return.
The three windows share recent observations. Their ratios are combined with weights 4, 2 and 1; they are not three independent confirmations. The 30/70 lines are illustrative reading levels, while 50 is a midpoint reference. None is a complete entry rule.
2. Build buying pressure and True Range
For each bar with a previous close, true low is min(low,previous close) and true high is max(high,previous close). BP is close minus true low; TR is true high minus true low. With valid OHLC, 0≤BP≤TR. A zero-range bar contributes zero to both sums.
Each A_n is the sum of BP divided by the sum of TR over the same n terms. It is not the simple average of individual bar BP/TR ratios. Wider ranges carry more weight inside that ratio. The table prints 100×A_n as a percentage; the formula uses the unrounded fractional ratios.
trueHigh[t] = max(H[t], C[t−1])
BP[t] = C[t] − trueLow[t]
TR[t] = trueHigh[t] − trueLow[t]
A[n,t] = Σ(BP, n) / Σ(TR, n)
UO[t] = 100 × (4×A[7,t] + 2×A[14,t] + A[28,t]) / 7
| Window · BP/TR terms | ΣBP · JPY/USD | ΣTR · JPY/USD | 100×A · % |
|---|---|---|---|
| A7 | 0.540 | 1.110 | 48.648649 |
| A14 | 1.650 | 2.980 | 55.369128 |
| A28 | 2.960 | 5.310 | 55.743879 |
3. Follow a completed-bar cross of 50
At 2024-01-31 02:00 UTC, UO rises from 46.272792 to 51.582390, while the close rises from 147.480 to 147.540. Our upward midpoint cross requires previous UO≤50 and current UO>50. Remaining above 50 on a later bar is not another upward cross.
At this hour, 100×A7 is only 48.648649, below 50, whereas 100×A14 is 55.369128 and 100×A28 is 55.743879. The weighted combination can be above 50 even when its shortest component is below it. Read the combination actually defined, rather than substituting the latest candle or one component.
A midpoint cross alone does not confirm a Williams divergence setup. Such a setup also needs defined price and oscillator pivots and a confirmation condition. This guide specifies no divergence pivots, entries, stops, exits or strategy returns. A is an observation.
4. Compare 4/2/1 with equal weights
One hour earlier, at 2024-01-31 01:00 UTC, 100×A7 is 39.215686, 100×A14 is 56.013746, and 100×A28 is 55.019305. The main 4/2/1 UO is 46.272792, below 50. Giving the three ratios equal weights produces 50.082912, just above 50. The same bars can yield different midpoint readings when the weights differ.
The main minus equal-weight difference is −3.810121 oscillator points, not a trading loss or return. The equal-weight line is an explanatory comparison fixed before calculation. It is not an optimized alternative or a replacement for the declared 4/2/1 UO.
The last bar itself closes at 147.480, up from 147.340, and its BP/TR is 93.750000%. Yet its seven-term ratio remains much lower. One strong-looking bar does not erase earlier ranges. The three cases are adjacent hours of this same episode, with heavily overlapping chart windows.
5. Let the previous close expand the range
At 2024-01-31 03:00 UTC, the previous close 147.540 lies below the current low 147.550. The current high is 147.700 and close 147.670. True low is therefore 147.540, giving BP=0.130 and TR=0.160 JPY per USD. Using only the current bar would instead give close−low=0.120 and high−low=0.150.
These are adjacent complete recorded hours; the adjustment does not mean that an H1 bar is missing. Including the previous close accounts for its position outside the current high/low range. If it lay above the current high, it would instead expand true high.
UO is now 58.018595, after 51.582390. Both values are above 50, so there is no fresh upward midpoint cross on this bar. This separates a current state from a new event. The explorer shows the price components for the selected bar, not just the final oscillator.
| Calculation component | Value |
|---|---|
| Previous close · JPY per USD | 147.540 |
| True low · JPY per USD | 147.540 |
| True high · JPY per USD | 147.700 |
| BP · JPY per USD | 0.130 |
| TR · JPY per USD | 0.160 |
6. Handle startup, zero ranges and incomplete data
The first recorded bar has no previous close, so its BP/TR terms are unavailable. Twenty-eight terms first become possible on the twenty-ninth bar. Shorter component ratios may appear earlier, but the full UO still needs all three windows. This finite-sum version has no EMA seed; older data outside the required window cannot change its current value.
For an available UO in this guide, all three TR sums must be positive. A zero-range window is unavailable rather than silently given a numeric contribution. Check this convention when comparing implementations. Unchanged closes alone do not imply zero TR: highs and lows may still span a range.
Numeric windows use retained bars, including partial hours and changes after recorded gaps; no missing price or hour is invented. Fresh-event labels additionally require both the current and previous windows to contain complete adjacent hours and available values. Consecutive hours across UTC midnight are allowed. Comparisons use exact unrounded values, not the six displayed decimals.
7. Inspect the fixed cases and their components
Choose the midpoint, weight or previous-close case. Move through the 80 recorded observations and open the component panel to inspect BP, TR and the three window sums. Main-only versus comparison view changes the plotted lines; 40/80 changes the visible crop. Neither changes the main UO, its events, or the selected example. The chart ends at A without future bars.
Loading retained historical readings…
UO · gold / 30,70 · dashed / A · observation
The chart ends at A. Earlier retained bars outside the visible crop still contribute to the window sums.
- H1 end · UTC
- —
- Close · JPY per USD
- —
- UO · 7/14/28 · 4/2/1
- —
- Equal-weight comparison · 1/1/1
- —
- Main minus comparison · points
- —
- Main UO versus 50
- —
- Illustrative 30/70 band
- —
- Fresh main-UO observation
- —
- Current recorded hour
- —
- Active calculation window
- —
Inspect BP, TR and window sums
- Previous close · JPY per USD
- —
- High · JPY per USD
- —
- Low · JPY per USD
- —
- True low · JPY per USD
- —
- True high · JPY per USD
- —
- BP · JPY per USD
- —
- TR · JPY per USD
- —
- BP7 sum · JPY per USD
- —
- TR7 sum · JPY per USD
- —
- 100×A7 · %
- —
- BP14 sum · JPY per USD
- —
- TR14 sum · JPY per USD
- —
- 100×A14 · %
- —
- BP28 sum · JPY per USD
- —
- TR28 sum · JPY per USD
- —
- 100×A28 · %
- —
- 28-term start close · UTC
- —
- Recorded bars before this observation
- —
All cases use fixed 7/14/28 periods. Main/comparison and 40/80 switches affect only the chart display. The examples are adjacent hours with overlapping history.
Frequently asked questions
Does UO 7/14/28 need 28 or 29 bars?
It needs 28 BP/TR terms, and the first term needs a previous close. The first possible full UO therefore requires 29 recorded bars. Here all three window TR sums must also be positive.
Are 7/14/28 three different chart timeframes?
No. Here they are three rolling windows on the same retained H1 series. They do not independently read H1, H4 and daily charts, and their recent observations overlap.
Why divide the BP sum by the TR sum?
That is the declared window ratio. It weights bar pressure ratios by their ranges, rather than taking a simple average of individual ratios. A zero-range bar adds zero to both sums without requiring a per-bar division.
Why do equal weights give a different reading?
At 2024-01-31 01:00 UTC, the short-window ratio is much lower than the two longer ratios. Main 4/2/1 UO is 46.272792; the fixed 1/1/1 comparison is 50.082912. This illustrates the weights, not better trading performance.
What happens when a range sum is zero?
This guide marks the full UO unavailable if any of its three range sums is zero. One zero-range bar does not automatically invalidate a window whose total TR remains positive. An unchanged close can still have nonzero high/low range.
Do these real charts test a Williams trading strategy?
No. The candles come from retained historical Forexite quotes, but the examples are indicator observations. A 50 cross alone does not define a complete divergence setup. We specify no executed trades or strategy returns.
Data, calculation choices and scope
We reuse 375,702 retained USD/JPY M1 records from Forexite’s 2024 Trade/MetaStock archives. The retained timestamps already apply the declared fixed GMT+1 to UTC conversion. Minute labels are interval ends and H1 groups are (start,end]. The original daily ZIPs were not downloaded again.
The reconstruction contains 6,265 recorded H1 bars: 6,178 complete and 87 partial, with 52 gaps before recorded hours. BP/TR after a gap uses the previous retained close. The three selected hours are 01:00, 02:00 and 03:00 UTC on 2024-01-31; their 80-bar windows overlap and are not independent samples.
One program uses exact integer prefix sums and 55-digit ratios. A separate 80-digit program rebuilds hours and uses an alternative equivalent BP/TR expression and direct window sums. Both were written by the same assistant; this checks reproducibility, not outside or terminal certification.
The downloads contain full hourly readings, exact closed-bar classifications, the saved specification, retained minute input, source checksums, both programs and verification results. The equal-weight curve is a fixed comparison. Reproduction instructions remain inside the downloadable ZIP.



