OBV Price Confirmation Chronology - On Balance VolumeOBV Price Confirmation Chronology is a price-volume research indicator that compares the timing of rolling record events in price and classical On-Balance Volume (OBV).
A standard OBV line shows how directionally signed volume has accumulated. This script adds a different analytical layer: when price and OBV establish corresponding upper or lower records, which one occurred first, did both occur on the same bar, or did one remain unmatched beyond the selected tolerance?
The purpose is to help users study whether the available volume series is confirming, leading, lagging, or failing to match new price records.
This is a descriptive context tool. It is not a trading system and does not generate buy or sell instructions, entries, exits, targets, stops, position sizes, probability estimates, or performance claims.
CORE IDEA
The script separately observes two event families:
- High-side records
- Low-side records
A high-side event occurs when price or classical OBV establishes a new upper record relative to its selected rolling lookback.
A low-side event occurs when price or classical OBV establishes a new lower record relative to its selected rolling lookback.
Price and OBV events are then paired within a configurable number of chart bars.
The resulting chronology state describes the order in which the matching records occurred:
- OBV led
- Price led
- Synchronized
- Price only
- OBV only
High-side and low-side states are calculated independently.
"High" and "Low" describe the direction of the rolling record. They are not long or short recommendations.
WHAT MAKES IT DIFFERENT
The classical OBV calculation itself is a standard technical-analysis foundation. The original contribution of this script is the chronology engine built around it.
The script does not simply plot OBV, detect an OBV moving-average crossover, or mark a one-sided OBV breakout.
Its distinguishing features include:
- Symmetrical high-side and low-side record analysis
- Independent price-record and OBV-record detection
- Bar-by-bar measurement of which record occurred first
- Synchronized-event classification when both records occur together
- Pending-event storage within a configurable pairing tolerance
- Unpaired-event classification when the tolerance expires
- Deterministic oldest-first event pairing
- Breakout-sequence compression to reduce repeated record events
- Optional sampled-record mode for more frequent research events
- A normalized OBV-versus-price range-position gap
- Compact historical markers
- Separate latest high-side and low-side labels
- A concise current-state table
- Confirmed-bar event handling by default
This is not a classic pivot-divergence indicator.
It does not wait for confirmed swing pivots, draw divergence lines between historical pivots, or classify regular and hidden divergence. It instead studies the chronology of rolling price and OBV records.
CLASSICAL OBV CALCULATION
Classical OBV is calculated from the selected Direction source.
When the source rises from the previous bar:
- The current available volume is added.
When the source falls from the previous bar:
- The current available volume is subtracted.
When the source is unchanged:
- Zero is added.
Close is the default Direction source.
The chronology engine always uses classical cumulative OBV, regardless of the selected visual display mode.
PRICE RECORDS
The Price record source can use:
- High / Low
- Close
With High / Low selected:
- High-side records are calculated from price highs.
- Low-side records are calculated from price lows.
With Close selected:
- Both upper and lower price records are calculated from closing prices.
A price record must exceed the previous rolling record by the configured Minimum price record extension.
The default extension is one minimum tick. This helps avoid treating insignificant floating-point or feed-level differences as meaningful new price records.
Setting the extension to zero accepts any strictly higher or lower value.
OBV RECORDS
A high-side OBV record occurs when classical OBV exceeds its previous rolling maximum.
A low-side OBV record occurs when classical OBV falls below its previous rolling minimum.
A usable positive volume input is required for a new OBV record event.
EVENT SAMPLING MODES
Breakout sequence start is the default event mode.
This mode groups a sustained run of repeated rolling records into a cleaner event sequence. A new event is allowed only after the selected number of reset bars has separated it from the preceding record run.
This reduces repeated markers during a continuous expansion.
Sampled rolling records is an alternative research mode.
It allows record events to appear more frequently, subject to the selected minimum number of bars between sampled events.
PAIRING LOGIC
High-side and low-side events maintain separate pending states.
When a price record occurs without a matching OBV record, the price event waits for the configured Pair tolerance bars.
When an OBV record occurs without a matching price record, the OBV event waits in the same way.
If the opposite record occurs within the tolerance, the events form a completed pair.
The script gives priority to the oldest valid unmatched event. A new event from the same source does not overwrite an older valid pending event.
The classifications are:
OBV led
The OBV record occurred first and the matching price record occurred later within the tolerance.
Price led
The price record occurred first and the matching OBV record occurred later within the tolerance.
Synchronized
The price and OBV records occurred on the same chart bar when no older opposite-source pending event had priority.
Price only
A price record remained unmatched after the tolerance expired.
OBV only
An OBV record remained unmatched after the tolerance expired.
The tolerance is measured in chart bars, not clock time.
A setting of eight therefore means eight bars on the active chart timeframe.
READING THE +N VALUE
A compact label such as:
OBV +3
means that the matching OBV record occurred three chart bars before the price record.
A compact label such as:
Price +2
means that the matching price record occurred two chart bars before the OBV record.
The number is not:
- Signal strength
- Price distance
- Volume percentage
- Expected return
- Reversal probability
- Continuation probability
It is only the number of chart bars separating the two record events.
VISUAL LANGUAGE
The default visual structure keeps the OBV series as the primary layer.
Default line colors:
- Cyan: displayed OBV series
- Yellow: selected smoothing line
Historical event markers:
- Diamond: completed price-OBV pair
- X: pending event expired without a matching event
Default marker colors:
- Blue: OBV led
- Gold: Price led
- White: Synchronized
- Gold X: Price only
- Violet X: OBV only
Marker position identifies the event side:
- Markers above the displayed OBV line represent high-side events.
- Markers below the displayed OBV line represent low-side events.
The latest high-side state is shown with a green label.
The latest low-side state is shown with a pink label.
Only one latest high-side label and one latest low-side label are maintained. Older event history remains available through the smaller markers.
All primary colors, line widths, label sizes, table settings, and visual layers can be customized.
STATUS TABLE
The default Compact table contains four rows:
High
Shows the latest completed or expired high-side chronology state.
Low
Shows the latest completed or expired low-side chronology state.
Pending
Shows whether a price or OBV record is currently waiting for a matching event.
A pending value such as:
H Price 3/8
means that a high-side price record has waited three bars out of an eight-bar tolerance.
Gap
Shows which series currently occupies the stronger relative position inside its own recent range.
The table can be moved to any corner of the indicator pane.
A Detailed table mode is also available for users who want additional state and environment information.
RANGE-POSITION GAP
Price and classical OBV are independently normalized to positions from 0 to 100 inside their respective recent ranges.
The calculation is:
OBV range position - Price range position
A positive result means OBV is positioned higher inside its own recent range than price is positioned inside its price range.
A negative result means price is positioned higher inside its own recent range than OBV is positioned inside its OBV range.
In Compact mode, the table displays the stronger side and the absolute difference.
For example:
OBV 22.5
means OBV is 22.5 normalized range-position points above price.
Price 31.0
means price is 31.0 normalized range-position points above OBV.
The Gap value is not a price percentage, volume percentage, probability, forecast, or signal-strength score.
An optional subtle background tint can highlight larger positive or negative gaps. It is disabled by default to preserve visual clarity.
DISPLAY MODES
Classic OBV
Displays classical cumulative OBV.
This is the default mode because it matches the series used by the chronology engine.
Rolling zero-base OBV
Displays the current classical OBV value minus its value a selected number of bars ago.
This can make recent movement easier to compare visually, but it does not change chronology calculations.
Directional balance %
Measures net directionally signed volume relative to gross directionally signed volume over the selected lookback and displays the result on a scale from -100 to +100.
This mode changes only the visible pane series.
Chronology events always remain based on classical cumulative OBV.
SMOOTHING
An optional smoothing line is enabled by default.
Available methods:
- EMA
- SMA
- RMA
- WMA
The smoothing line is a visual reference only. It does not change price-record detection, OBV-record detection, pairing, pending events, expiration, or alert conditions.
ALERTS
The script provides separate alert conditions for:
- High-side OBV led
- High-side Price led
- High-side Synchronized
- Low-side OBV led
- Low-side Price led
- Low-side Synchronized
- Unpaired chronology expiration
The unpaired alert is disabled by default.
All alerts are restricted to confirmed bar closes.
Alert events describe completed chronology conditions only. They are not trade instructions.
LIVE AND HISTORICAL BEHAVIOR
Evaluate confirmed bars only is enabled by default.
With this setting enabled:
- Persistent chronology states update only when the current chart bar closes.
- Pending records do not pair or expire during an unfinished bar.
- Historical and realtime event handling remain aligned around confirmed chart bars.
The displayed OBV line, smoothing line, and range-position gap can still update while the current bar is forming because their underlying price and volume values are live.
If confirmed-bar evaluation is disabled, chronology events become a provisional intrabar preview. Those states can change before the bar closes.
Alerts remain confirmed-bar events even when intrabar preview is enabled.
The script uses the current chart timeframe only.
It does not request higher-timeframe or lower-timeframe data, does not use lookahead, and does not use future bars.
An unpaired X marker appears on the bar where the expiration becomes knowable, not retrospectively on the original pending-event bar.
NON-STANDARD CHARTS
Chronology-event processing is paused by default on non-standard chart types, including synthetic price constructions such as:
- Heikin Ashi
- Renko
- Kagi
- Point & Figure
- Range
- Line Break
Standard candlestick or bar charts are recommended.
INPUTS AND CUSTOMIZATION
Users can adjust:
- OBV Direction source
- Visible display mode
- Rolling zero-base length
- Directional-balance length
- Smoothing method and length
- Price record source
- Record lookback
- Record event mode
- Sequence reset bars
- Sampled-event spacing
- Pair tolerance
- Minimum price-record extension
- Confirmed-bar behavior
- Non-standard-chart behavior
- Historical markers
- Latest labels
- Label style and size
- Table position
- Compact or Detailed table density
- Table text size and formatting
- OBV and smoothing line widths
- Range-position lookback
- Gap threshold and optional tint
- Primary colors
- Alert availability
Visual settings do not change the underlying chronology calculations.
SUGGESTED WORKFLOW
1. Use a standard candlestick chart with a consistent and meaningful volume series.
2. Begin with Classic OBV so the displayed series matches the chronology basis.
3. Review the High and Low rows separately. They represent different record directions and can show different chronology states at the same time.
4. Use the historical diamonds to locate completed price-OBV pairs.
5. Use the historical X markers to locate events that expired without confirmation.
6. Read the +N value only as a bar-count lead or lag.
7. Review Pending to see whether a price or OBV record is still waiting for a counterpart.
8. Use Gap as secondary range-position context, not as a trade trigger.
9. Adjust Record lookback, Sequence reset bars, and Pair tolerance for the timeframe and research horizon.
10. Combine the observations with independent price structure, trend, volatility, liquidity, and risk analysis.
LIMITATIONS
OBV is derived from the volume series supplied for the selected symbol and data provider.
Depending on the market, the available series may represent:
- Exchange trade volume
- Exchange-specific crypto volume
- Broker-specific volume
- Tick volume
- Limited volume
- No usable volume
The interpretation and quality of all OBV-based calculations therefore depend on the symbol and feed.
If no usable volume is available, the OBV series may remain flat or the chronology may not provide meaningful events.
The absolute numerical level of cumulative OBV is not directly comparable between unrelated symbols.
Large isolated volume events can affect the cumulative OBV path for an extended period.
Corporate actions, session changes, market gaps, futures contract rolls, and provider-specific data changes can affect price and volume records.
Record events depend on the selected lookback and price source.
Pairing results depend on the selected tolerance.
Lower timeframes can produce more frequent and noisier events.
Higher timeframes generally produce fewer events and require more elapsed time for pending states to complete or expire.
Price-only and OBV-only states do not predict reversal or continuation.
OBV leadership does not guarantee that price will follow.
Price leadership does not guarantee that OBV will confirm.
Synchronized records do not guarantee trend persistence.
Range-position Gap does not represent a trading edge or future probability.
Default parameters are research starting points and are not optimized for any symbol, timeframe, market, or trading method.
This indicator should be used as one descriptive price-volume perspective within a broader analytical process.
Chỉ báo






















