OPEN-SOURCE SCRIPT

Rolling VWAP + Volume Profile by Flip On Dip

1 172
Rolling VWAP + Volume Profile draws a volume weighted average over a moving window of trading days, and a separate volume profile for each of the last few sessions.

🔁 The VWAP here is not anchored. Instead of resetting at the open it holds a sliding window of the last N sessions, so the line carries through the open and over the weekend without jumping. Two deviation bands sit either side, built from the volume weighted standard deviation rather than a plain one, so they widen when size trades away from the mean instead of just following range.

🕐 Session length is measured off the chart rather than assumed. A 6.5 hour stock day, a 23 hour gold day and a 24 hour crypto day all count as one day, so a 7 day window really is seven sessions on any symbol at any timeframe.

📊 Each session gets its own profile, built from a candle step you set. That step is independent of your chart, so the same 5m profile shows up whether you're looking at a 1m or a 1h chart and switching timeframes won't change the shape. Volume from each candle is spread across every level it touches, weighted by how much of the candle's range falls inside each one, instead of being dumped at the close. Point of control and value area are marked, and the session in progress rebuilds as it fills.

On that last point, worth being clear about what moves and what doesn't. The session in progress is live and will keep changing until it closes, roughly once a minute as volume comes in. That's the whole idea of a developing profile. Once a session ends its profile is drawn once and never touched again, so nothing behind you shifts around. The VWAP behaves the same way: it updates on the current bar like any average does, and past values stay where they were.

Two horizons. Micro gives daily profiles with a week long VWAP, Macro switches to weekly profiles with a fortnight long VWAP across a longer stretch of history. Each one keeps its own settings, so flipping between them doesn't cost you your tuning.

⚠️ Not every ticker reports real volume, and that changes what a profile means. Spot gold, most FX and index feeds publish nothing at all, while forex and CFD tickers that do publish are usually counting ticks rather than contracts. The indicator checks and tells you which one you're on. Where there's no volume it falls back to counting time spent at each price, which is still a useful map of where the market lingered, and the panel says so rather than leaving you to work out why the shape looks odd.

The panel in the corner handles the rest of it. Active horizon, VWAP window, profile step, and whether volume on this ticker is traded, tick only or missing. If something is quietly limiting the drawing, the chart timeframe being wrong for the horizon, the 500 box platform limit, not enough history loaded for the window you asked for, it writes it out in plain words with what to change.

There's also an optional fixed step for the VWAP itself, which makes the line identical on every timeframe. Off by default, since the chart bars are what most people expect.

⚡ Nothing is calculated outside the visible window, and every box and line is allocated once and reused instead of being deleted and redrawn, so panning around stays smooth even on long intraday history.

Three colour presets, Default, Light and Dark, or Custom to set every colour and transparency yourself. Row spacing and width, gradients, borders, POC and VAH/VAL lines, the 3D shadow, price labels and the panel are all configurable.

Open source, free to study or extend.

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.