PROTECTED SOURCE SCRIPT
Aggiornato

VWAP Slices

150
VWAP Slices is a time-based analytical tool that helps traders evaluate market behavior across custom-defined periods. Instead of looking at VWAP, RSI, or MFI in isolation, this script allows users to select up to three specific time windows — for example, earnings weeks, Fed meetings, or major news cycles — and analyze how price interacted with volume, momentum, and money flow within each of those slices.

For each active period, the script calculates:

  • VWAP, based on HLC3 × Volume, giving a volume-weighted price anchor
  • Total traded volume
  • Number of bars (candles) in the period
  • RSI, computed using a custom-built relative strength algorithm from closing prices
  • MFI, calculated from HLC3 and volume to assess money flow direction and strength

These statistics are not simply shown independently — they are designed to be viewed in context with each other. For instance:

VWAP levels help identify fair value and possible accumulation/distribution zones within a time range.

RSI shows internal momentum strength, while MFI adds a volume-sensitive confirmation.

Comparing multiple periods side-by-side allows traders to see shifts in trend behavior and volume dynamics over time.

The script offers two visualization styles:

  • Labels placed on-chart near price, summarizing each period
  • A combined table showing all periods together for comparative analysis

Users can define:

  • Start and end dates of each period
  • Background color and visibility per period
  • Whether to display labels, a summary table, or both


It also computes aggregate metrics, including:

  • A volume-weighted combined VWAP across all selected periods
  • Average RSI and MFI, giving a broader sense of directional bias and money flow health

This tool is especially useful for:

  • Assessing how price and volume behaved around specific market events
  • Comparing accumulation vs distribution across different timeframes
  • Supporting thesis-driven trading by segmenting history into actionable chunks


This is not a mashup, but a purposeful framework for slicing market history into analytical blocks — combining price anchors with volume and momentum indicators to help traders better interpret price structure and trend context.
Note di rilascio
VWAP Slices: Deep Dive Analysis for Custom Periods

Overview
This indicator empowers you to conduct precise Volume Weighted Average Price (VWAP) analysis across up to three distinct, user-defined time periods or "slices." Unlike traditional VWAP indicators that reset on a fixed session basis (daily, weekly, etc.), VWAP Slices allows you to anchor your analysis to any start and end time you choose.
This is perfect for analyzing specific market phases, the reaction to a news event, a consolidation range, or any custom period you wish to investigate.

Core Concept
Standard VWAP is a powerful tool, but its rigid reset schedule can be limiting. Have you ever wanted to know the VWAP of a specific multi-week trend, the period between two major earnings reports, or just the volume-weighted price of last month's price action?
This script was built to answer exactly those questions. By defining your own "slices" of time, you can gain unique insights into where the market's value area was during crucial periods, independent of standard session times.

Key Features
Up to Three Custom Time Slices: Define three independent periods with a simple start and end time selector for your analysis.
Hybrid Timeframe VWAP Calculation: This is the script's secret sauce. The VWAP for your selected slice is calculated using a higher-resolution timeframe (e.g., 30-minute) even while you view the indicator on a daily chart. This provides a much more precise VWAP than one calculated from the chart's own bars.
Comprehensive Chart-Based Metrics: While VWAP gets its precision from a higher timeframe, all other metrics are calculated based on your chart's timeframe. This gives you a perfect blend of precision and context. For each slice, the script calculates:
Total Volume: The sum of volume for the bars on your chart within the slice.
Bar Count: The number of bars on your chart within the slice.
Period RSI: The Relative Strength Index calculated across the entire slice.
Period MFI: The Money Flow Index calculated across the entire slice.
Flexible Display Options: Choose how you want to see the results:
Table: A clean, organized table summarizing the metrics for all enabled periods, including a consolidated "ALL" row.
Labels: On-chart labels that appear over the midpoint of each time slice for quick reference.
Both: Display both the table and the on-chart labels.
Full Customization: Control the color and transparency for each time slice's background highlight, making your chart easy to read.

How to Use
Add the "VWAP Slices" indicator to your chart.
Go into the script's Settings.
Under the "Period 1" group, check "Enable Period 1".
Select your desired Start Time and End Time for the analysis.
In "Display Options", choose the "VWAP Calculation Timeframe". A lower timeframe (like "30" or "60" minutes) will result in a more precise VWAP.
Enable and configure Periods 2 and 3 as needed.
Choose your preferred "Display Style" (Table, Label, or Both).

Final Notes
This tool was designed for traders who want to go beyond conventional analysis and ask more specific questions about market behavior. By slicing the market into custom periods, you can uncover new levels of support, resistance, and value that might otherwise be hidden.
Feel free to use this tool to enhance your analysis. If you have any feedback or suggestions for improvement, please leave a comment below. Happy trading
Note di rilascio
- Fixed Monetary Volume Calculation
Note di rilascio
- Minor Code Cleanup
Note di rilascio
-Better Anchoring logic for bgcolor
Note di rilascio
-massive performance improvements.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.