OPEN-SOURCE SCRIPT
VWAP – Pivot Pairs (SECONDS‑BASED RESET)

VWAP – Pivot Pairs (SECONDS-BASED RESET) is a Pine Script v6 indicator for TradingView that combines pivot-based breakout detection with resettable VWAP (Volume Weighted Average Price) calculations over user-defined rolling time periods in seconds.It identifies high and low swing pivots via breakout logic, then calculates two VWAP lines per anchor:One using high/low as the price source,
One using close as the price source.
These form "pivot pairs" that reset automatically at the start of each custom-duration period (e.g., every 300 seconds), starting from a user-defined UTC time of day (default: 09:30 UTC).Visuals include:Colored VWAP lines (high pair: red, low pair: green),
Semi-transparent fill zones between each pair,
Optional toggles to show/hide high or low pairs.
Use CasesUse Case
Description
Intraday Scalping (1–15 min charts)
Use 60–300 second resets to capture micro-trends within larger sessions. VWAP pairs act as dynamic support/resistance after breakouts.
High-Frequency / Algo Validation
Backtest strategies on tick/second charts where traditional session resets fail. Align resets with exchange micro-sessions or volatility windows.
Opening Range Breakout (ORB) Enhancement
Set period_seconds = 1800 (30 min) and start time = 09:30 UTC → VWAP builds only on first 30 mins post-open, then floats. Pairs show deviation from ORB mean.
Range-Bound Market Analysis
In choppy markets, VWAP pairs converge near fair value. Divergence signals potential breakout. Fill color intensity shows conviction.
Multi-Timeframe Confluence
Overlay on 1-second chart with 300s reset → matches 5-minute structure. Use close-based VWAP for entries, high/low-based for stops.
Key Features SummaryFeature
Function
period_seconds
Rolling window length in seconds (e.g., 300 = 5 min)
period_start_time
UTC time-of-day anchor (default: 09:30)
new_period logic
Triggers full reset of pivots + VWAP on exact second boundary
breakingHigher / breakingLower
Detects confirmed breakouts (not just close above high)
Dual VWAP per anchor
ta.vwap(high) and ta.vwap(close) for range-aware mean
Fill zones
Visual value area between high/close VWAPs
Toggle visibility
Independently show/hide high or low pivot pairs
How It Works – Step-by-StepTime Engine Converts user inputs → milliseconds
Calculates current period start time using integer division from epoch
Detects exact bar when new period begins (new_period = true)
On New Period Resets both high/low anchors to current bar’s h and l
Forces VWAP recalculation from this bar forward
Breakout Detection Only triggers on strong candles (rising/falling, non-doji)
Requires open/close beyond prior pivot → avoids wicks-only breaks
VWAP Accumulation ta.vwap(source, reset_condition) restarts when anchor resets
Two sources per side → shows where volume clustered (at highs vs closes)
Plotting Four lines + two fills
Clean, customizable, overlay-friendly
Pro TipsUse on Heikin Ashi for smoother breakout signals.
Combine with volume profile to validate VWAP clusters.
For crypto, set period_start_time = 0 (00:00 UTC) for clean 4-hour resets.
Add alerts on new_period or breakingHigher for automation.
In short: This is a precision VWAP tool for time-boxed, pivot-driven mean reversion and breakout trading, ideal for scalpers, day traders, and algo developers needing sub-session granularity.
One using close as the price source.
These form "pivot pairs" that reset automatically at the start of each custom-duration period (e.g., every 300 seconds), starting from a user-defined UTC time of day (default: 09:30 UTC).Visuals include:Colored VWAP lines (high pair: red, low pair: green),
Semi-transparent fill zones between each pair,
Optional toggles to show/hide high or low pairs.
Use CasesUse Case
Description
Intraday Scalping (1–15 min charts)
Use 60–300 second resets to capture micro-trends within larger sessions. VWAP pairs act as dynamic support/resistance after breakouts.
High-Frequency / Algo Validation
Backtest strategies on tick/second charts where traditional session resets fail. Align resets with exchange micro-sessions or volatility windows.
Opening Range Breakout (ORB) Enhancement
Set period_seconds = 1800 (30 min) and start time = 09:30 UTC → VWAP builds only on first 30 mins post-open, then floats. Pairs show deviation from ORB mean.
Range-Bound Market Analysis
In choppy markets, VWAP pairs converge near fair value. Divergence signals potential breakout. Fill color intensity shows conviction.
Multi-Timeframe Confluence
Overlay on 1-second chart with 300s reset → matches 5-minute structure. Use close-based VWAP for entries, high/low-based for stops.
Key Features SummaryFeature
Function
period_seconds
Rolling window length in seconds (e.g., 300 = 5 min)
period_start_time
UTC time-of-day anchor (default: 09:30)
new_period logic
Triggers full reset of pivots + VWAP on exact second boundary
breakingHigher / breakingLower
Detects confirmed breakouts (not just close above high)
Dual VWAP per anchor
ta.vwap(high) and ta.vwap(close) for range-aware mean
Fill zones
Visual value area between high/close VWAPs
Toggle visibility
Independently show/hide high or low pivot pairs
How It Works – Step-by-StepTime Engine Converts user inputs → milliseconds
Calculates current period start time using integer division from epoch
Detects exact bar when new period begins (new_period = true)
On New Period Resets both high/low anchors to current bar’s h and l
Forces VWAP recalculation from this bar forward
Breakout Detection Only triggers on strong candles (rising/falling, non-doji)
Requires open/close beyond prior pivot → avoids wicks-only breaks
VWAP Accumulation ta.vwap(source, reset_condition) restarts when anchor resets
Two sources per side → shows where volume clustered (at highs vs closes)
Plotting Four lines + two fills
Clean, customizable, overlay-friendly
Pro TipsUse on Heikin Ashi for smoother breakout signals.
Combine with volume profile to validate VWAP clusters.
For crypto, set period_start_time = 0 (00:00 UTC) for clean 4-hour resets.
Add alerts on new_period or breakingHigher for automation.
In short: This is a precision VWAP tool for time-boxed, pivot-driven mean reversion and breakout trading, ideal for scalpers, day traders, and algo developers needing sub-session granularity.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.