Previous Day Value Area - CriptoMatiko## Description
The **Previous Day Value Area** replicates, bar-for-bar, the exact volume-area calculation used in our own Python volume profile backtester. Every VAH/POC/VAL value this indicator plots can be checked line-by-line against the backtester's output — that's the reason this exists: TradingView's native Volume Profile does its own internal binning, which you can't inspect or reproduce outside the platform. This one gives you a value area you can actually verify.
---
**How it works**
1. Pulls 1-minute bars for each session (`request.security_lower_tf`).
2. Splits each 1-minute bar's volume evenly across every price bucket its high-low range touches ("bar-distributed" volume) — same method as the Python backtester, not TradingView's built-in binning.
3. POC = the price bucket that accumulated the most volume.
4. Expands outward from the POC toward the heavier side until 70% (configurable) of the day's total volume is captured. The two edges of that range are VAL and VAH.
5. Bucket resolution is fixed once at session open and held constant until the session closes, so keys never shift mid-calculation.
---
**Visuals**
- Lines — the previous day's VAH / POC / VAL, projected across the current session (what a systematic detector would read)
- Optional histogram — the volume profile silhouette for each session, drawn as a mirrored buy/sell split
- Comparison mode — draws the value area over the same day that produced it, for side-by-side visual checks against other volume-profile tools
- Table (top-right) — previous day's date, VAH, POC, VAL, plus the current (in-progress) session's values
---
**Parameters**
- Value area %: percentage of volume captured between VAL and VAH (default 70%)
- Profile resolution: automatic (% of price), fixed bucket size, or rows based on D-1's range
- Project D-1 value area: shows the previous day's finished levels across the current session
- Comparison mode: draws the levels on the day that generated them instead of projecting forward
- Histogram rows / width: controls the resolution and size of the drawn volume profile
- Split buy/sell volume: separates the histogram into up-close and down-close volume
---
**Originality**
This is not a variant of the built-in Volume Profile — it's a from-scratch bar-distributed volume calculation written to match a specific Python backtesting pipeline, so that value-area levels computed in code and value-area levels seen on the chart are provably the same numbers.
---
**Credits**
Author: Vernon CriptoMatiko
Chỉ báo






















