OPEN-SOURCE SCRIPT
YURI VWAP Sigma Engine

Session VWAP with volume weighted deviation bands, and a read on whether today's bands are wide or narrow for this point in the session. The bands are the ordinary part. The comparison against the clock is the part that is not available anywhere else, and it is the reason this exists.
WHAT THE BANDS ARE
VWAP is the average price every share traded at today, weighted by size. It is the benchmark institutional execution is measured against, which is most of why price keeps coming back to it. The bands are the volume weighted standard deviation of that same distribution, so they widen as the session builds disagreement and stay tight when it does not.
The deviation readout is the first number. "1.8 sigma above VWAP" says you are paying more than almost anyone else did today. Whether that is a breakout or a bad fill is a separate question this does not answer.
THE PROBLEM WITH BAND WIDTH
Band width on its own cannot be read, and the reason is structural rather than a matter of tuning. Width is a function of how far into the session you are. Sigma at 09:45 is small on every day that has ever been recorded, and sigma at 15:30 is large on every day that has ever been recorded, because the distribution simply has more in it by then. An absolute width therefore tells you the time of day and almost nothing about the day.
Comparing today's width at 10:15 against the width at 10:15 on each of the last twenty sessions removes the part that belongs to the clock. What is left belongs to today: this session is running wider than it normally is by now, or tighter.
Two details make that comparison mean anything. Width is measured relative to VWAP rather than in points, because the same instrument at 400 and at 700 does not produce comparable point spreads. And the comparison window is short on purpose, twenty sessions by default, so the reference is the volatility regime you are actually trading in rather than an average across several of them. A quiet day inside a violent month should not read as wide.
THE DISCLAIMER THAT TURNS INTO A FEATURE
Every VWAP band implementation carries the same warning: the bands are unreliable in the first fifteen to thirty minutes, because there is not enough volume in the distribution yet and they come out far too narrow.
Half of that stops mattering here. The under sampling applies equally to today and to every session today is being compared against, because they are being compared at the same point on the same clock with the same amount of data behind them. The absolute number early in the session is still meaningless. The comparison is not.
The half that does not go away is that a percentile built from six bars moves around far more than one built from sixty, and comparing like for like removes the bias without removing that. Measured across sixty sessions the percentile moves roughly eleven points a bar in the first half hour against roughly one point a bar after midday. So the early read is tagged rather than hidden. The first half hour is when a read on the session is actually worth having, and a noisy number that says it is noisy beats waiting until lunchtime for a number the session has already made obvious.
WHY NOT THE BUILT IN
The built in VWAP will draw the same bands, and if bands are all you want then use it. What it cannot do is tell you what today's width means, because that requires holding the width from previous sessions slot by slot and comparing like for like. The bands here are the input to that. The output is the state, the percentile, the multiple of a typical day, and the dotted envelope showing where the outer band sat at this exact point of the session on a median day.
THE PART THAT ACTUALLY MATTERS
A state has to hold for several bars before it gets named.
Drop that and this becomes a threshold that flips every time the percentile wobbles across the line, and within a week you have learned to ignore it. The hold period is the difference between a session read and a flicker. It is exposed in the inputs, it resets at every session open because the state describes today rather than yesterday, and there is no correct setting, only the one that matches how often you are willing to change your mind.
READING IT
Blue line is VWAP. Solid grey lines are the inner and outer bands, at one and two sigma by default.
Dotted line is the typical day. It is where the outer band sat at this point of the session across the comparison window. Today's band outside the dotted line is an expansion, inside it is a quiet day, and the distance between them is the whole read made visible without looking at a number.
The band shading carries the state. Orange is wide, blue is narrow, teal is normal, grey means there is no read yet.
The table gives the multiple of a typical day, the state with its percentile in brackets, how many sessions the comparison is actually running against, the current deviation in sigma, the distance from VWAP in percent, and how many times price has touched each outer band today.
The bracketed percentile is worth watching on its own because it moves before the label does. A percentile climbing through the middle seventies tells you the state is about to be named while the hold period is still counting.
Two words appear in the state that are not states. Forming means the session has just opened and the label has reset but not yet held long enough to be named, so the percentile is live and the label is not. Early means you are still inside the window where the percentile is built on very few bars, and it is a tag on the number rather than a different number.
SETTINGS THAT MATTER
Sessions to compare against sets the reference. Shorter reacts to the current regime and will call a wide day normal once wide days become the regime. Longer is a more stable reference and slower to accept that the regime has changed.
The wide and narrow percentiles are separate inputs. There is no reason a wide day and a quiet day have to be equally rare in your reading of the market, and if you want one side more sensitive, move that one and leave the other alone.
Sessions needed before it reads is a floor on the sample. Below it the table says warming up rather than computing a percentile out of four numbers.
Minutes before the read is trusted moves the early tag and nothing else. It changes no number and hides no reading. Set it to zero if you would rather judge the sample size yourself.
The anchor controls the VWAP reset only. The clock comparison needs a daily anchor, since a weekly or monthly anchor has no session clock to normalise against, and the table says so rather than printing a number that does not mean anything.
WHAT IT WILL NOT DO
It does not generate entries or exits, and it is not a forecast. A wide session is not a short and a narrow one is not a breakout setup. Width describes how much disagreement the session has built, not which side wins it, and the same reading precedes both a reversal and a trend continuation often enough that treating it directionally is a mistake the indicator cannot stop you making.
It needs real volume. On instruments where the feed reports tick counts instead, VWAP and everything built on it are approximations, and spot FX in particular has no consolidated volume at all.
It needs a clock, though not necessarily a closing bell. On a symbol that never closes the exchange day still rolls over, so the comparison runs against that boundary and produces a read rather than refusing one. Whether the roll of a twenty four hour day marks anything real for the instrument in front of you is your judgement to make, not the script's.
The comparison history is built as the script runs across the chart, so the read needs the comparison window plus the minimum sample to have gone past before it says anything. On a fresh chart that is the first few weeks of visible history, not the first bar.
This is context for a decision, not the decision.
WHAT THE BANDS ARE
VWAP is the average price every share traded at today, weighted by size. It is the benchmark institutional execution is measured against, which is most of why price keeps coming back to it. The bands are the volume weighted standard deviation of that same distribution, so they widen as the session builds disagreement and stay tight when it does not.
The deviation readout is the first number. "1.8 sigma above VWAP" says you are paying more than almost anyone else did today. Whether that is a breakout or a bad fill is a separate question this does not answer.
THE PROBLEM WITH BAND WIDTH
Band width on its own cannot be read, and the reason is structural rather than a matter of tuning. Width is a function of how far into the session you are. Sigma at 09:45 is small on every day that has ever been recorded, and sigma at 15:30 is large on every day that has ever been recorded, because the distribution simply has more in it by then. An absolute width therefore tells you the time of day and almost nothing about the day.
Comparing today's width at 10:15 against the width at 10:15 on each of the last twenty sessions removes the part that belongs to the clock. What is left belongs to today: this session is running wider than it normally is by now, or tighter.
Two details make that comparison mean anything. Width is measured relative to VWAP rather than in points, because the same instrument at 400 and at 700 does not produce comparable point spreads. And the comparison window is short on purpose, twenty sessions by default, so the reference is the volatility regime you are actually trading in rather than an average across several of them. A quiet day inside a violent month should not read as wide.
THE DISCLAIMER THAT TURNS INTO A FEATURE
Every VWAP band implementation carries the same warning: the bands are unreliable in the first fifteen to thirty minutes, because there is not enough volume in the distribution yet and they come out far too narrow.
Half of that stops mattering here. The under sampling applies equally to today and to every session today is being compared against, because they are being compared at the same point on the same clock with the same amount of data behind them. The absolute number early in the session is still meaningless. The comparison is not.
The half that does not go away is that a percentile built from six bars moves around far more than one built from sixty, and comparing like for like removes the bias without removing that. Measured across sixty sessions the percentile moves roughly eleven points a bar in the first half hour against roughly one point a bar after midday. So the early read is tagged rather than hidden. The first half hour is when a read on the session is actually worth having, and a noisy number that says it is noisy beats waiting until lunchtime for a number the session has already made obvious.
WHY NOT THE BUILT IN
The built in VWAP will draw the same bands, and if bands are all you want then use it. What it cannot do is tell you what today's width means, because that requires holding the width from previous sessions slot by slot and comparing like for like. The bands here are the input to that. The output is the state, the percentile, the multiple of a typical day, and the dotted envelope showing where the outer band sat at this exact point of the session on a median day.
THE PART THAT ACTUALLY MATTERS
A state has to hold for several bars before it gets named.
Drop that and this becomes a threshold that flips every time the percentile wobbles across the line, and within a week you have learned to ignore it. The hold period is the difference between a session read and a flicker. It is exposed in the inputs, it resets at every session open because the state describes today rather than yesterday, and there is no correct setting, only the one that matches how often you are willing to change your mind.
READING IT
Blue line is VWAP. Solid grey lines are the inner and outer bands, at one and two sigma by default.
Dotted line is the typical day. It is where the outer band sat at this point of the session across the comparison window. Today's band outside the dotted line is an expansion, inside it is a quiet day, and the distance between them is the whole read made visible without looking at a number.
The band shading carries the state. Orange is wide, blue is narrow, teal is normal, grey means there is no read yet.
The table gives the multiple of a typical day, the state with its percentile in brackets, how many sessions the comparison is actually running against, the current deviation in sigma, the distance from VWAP in percent, and how many times price has touched each outer band today.
The bracketed percentile is worth watching on its own because it moves before the label does. A percentile climbing through the middle seventies tells you the state is about to be named while the hold period is still counting.
Two words appear in the state that are not states. Forming means the session has just opened and the label has reset but not yet held long enough to be named, so the percentile is live and the label is not. Early means you are still inside the window where the percentile is built on very few bars, and it is a tag on the number rather than a different number.
SETTINGS THAT MATTER
Sessions to compare against sets the reference. Shorter reacts to the current regime and will call a wide day normal once wide days become the regime. Longer is a more stable reference and slower to accept that the regime has changed.
The wide and narrow percentiles are separate inputs. There is no reason a wide day and a quiet day have to be equally rare in your reading of the market, and if you want one side more sensitive, move that one and leave the other alone.
Sessions needed before it reads is a floor on the sample. Below it the table says warming up rather than computing a percentile out of four numbers.
Minutes before the read is trusted moves the early tag and nothing else. It changes no number and hides no reading. Set it to zero if you would rather judge the sample size yourself.
The anchor controls the VWAP reset only. The clock comparison needs a daily anchor, since a weekly or monthly anchor has no session clock to normalise against, and the table says so rather than printing a number that does not mean anything.
WHAT IT WILL NOT DO
It does not generate entries or exits, and it is not a forecast. A wide session is not a short and a narrow one is not a breakout setup. Width describes how much disagreement the session has built, not which side wins it, and the same reading precedes both a reversal and a trend continuation often enough that treating it directionally is a mistake the indicator cannot stop you making.
It needs real volume. On instruments where the feed reports tick counts instead, VWAP and everything built on it are approximations, and spot FX in particular has no consolidated volume at all.
It needs a clock, though not necessarily a closing bell. On a symbol that never closes the exchange day still rolls over, so the comparison runs against that boundary and produces a read rather than refusing one. Whether the roll of a twenty four hour day marks anything real for the instrument in front of you is your judgement to make, not the script's.
The comparison history is built as the script runs across the chart, so the read needs the comparison window plus the minimum sample to have gone past before it says anything. On a fresh chart that is the first few weeks of visible history, not the first bar.
This is context for a decision, not the decision.
Open-source script
In true PulseWire 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 PulseWire. Read more in the Terms of Use.
Open-source script
In true PulseWire 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 PulseWire. Read more in the Terms of Use.
