Fathom VWAP
Session or rolling VWAP, with three bands.
At a glance
- Identifier
vwap-bands- Objects received
point- Historical cost
- 1 compute unit per trade
What the indicator shows
- The central line is the VWAP: the session’s average price, weighted by the volume traded at each price.
- The three pairs of bands, above and below, measure the distance from the VWAP, in standard deviations or as a percentage.
How to use it
- Above the VWAP, price trades higher than the session’s average; below it, lower.
- The outer bands locate the extremes, from which price tends to return toward the average.
- In a trend, pullbacks to the VWAP or the first band often act as support or resistance.
barsgives a rolling VWAP over the last bars, independent of the start of the session.
How it is computed
daily: session VWAP, which starts over at every session open, at 18:00 New York time (full session, not only the RTH session);periodValuemust then be 1.bars: rolling VWAP over the lastperiodValuefinished bars.- The standard deviation is the volume-weighted standard deviation of prices, with a Bessel correction on volume: √(Σ v·(p − VWAP)² / (V − 1)), where V is the total volume; it is 0 while V is at most 2.
- The bands sit
first,secondandthirdstandard deviations from the VWAP (standard-deviation), or as many percent of the VWAP (price-percentage:0.25puts the band 0.25% from the VWAP, 50 points for a 20,000-point VWAP). These three values range from 0.01 to 10, with at most two decimals. Their order is not enforced: keepfirst<second<thirdfor inner-to-outer bands.
When it updates
- One point per finished
timeframe-second bar, sent once, final, when the bar closes; itsidis the start of the bar. No value is published inside a bar. The values hold at the bar’s end but are placed at its start: draw them as steps (each value from its bar’s start to the next one), not as a line through the bar starts. - A field is only absent when its value is undefined (zero cumulative volume): in practice, every field is present.
- Weekly reset: at the Sunday reopen (18:00 New York time), the computation starts over, rolling window (
bars) included; the week’s last bar gets its point on the first trade of the reopen.
Subscribe
The same params work in real time, on historical data and in exports. Parameters you omit take the defaults of the instrument’s ticker.
{
"t": "subscribe",
"sub": "vwap-bands",
"instrument": "NQ.front",
"indicator": "vwap-bands",
"params": {
"envelopeMode": "standard-deviation",
"first": 1,
"periodMode": "daily",
"periodValue": 1,
"second": 2,
"third": 3,
"timeframe": 300
},
"mode": "live",
"from": "live"
}Parameters
As soon as a parameter differs from its default on the instrument’s ticker, the subscription counts as a custom configuration. To change a parameter, open a new subscription.
Every ticker currently uses the generic defaults of the Default column. Defaults can be set per ticker and are regularly updated, ticker by ticker: an update changes the results of the subscriptions and queries that rely on them. A subscription whose parameters are all at its instrument’s defaults is not a custom configuration. Only explicit parameters keep a computation identical over time: pass them to keep the same results.
| Parameter | Type | Role | Default | Allowed values | Unit | Description |
|---|---|---|---|---|---|---|
envelopeMode | choice | Computation | standard-deviation | standard-deviation · price-percentage | — | Bands in standard deviations (standard-deviation) or as a percentage of the VWAP (price-percentage). |
first | number | Computation | 1 | 0.01 to 10 | — | Distance of band 1 from the VWAP, from 0.01 to 10, with at most two decimals: in standard deviations (1.5), or in percent of the VWAP with price-percentage (0.25 = 0.25%). |
periodMode | choice | Computation | daily | daily · bars | — | Session VWAP (daily) or rolling over periodValue bars (bars). |
periodValue | integer | Computation | 1 | 1 to 10,000 | bars | Number of bars in the rolling window with bars; must be 1 with daily. |
second | number | Computation | 2 | 0.01 to 10 | — | Distance of band 2 from the VWAP, in the same unit, from 0.01 to 10, with at most two decimals. |
third | number | Computation | 3 | 0.01 to 10 | — | Distance of band 3 from the VWAP, in the same unit, from 0.01 to 10, with at most two decimals. |
timeframe | integer | Computation | 300 | 1 · 5 · 10 · 15 · 30 · 60 · 120 · 180 · 300 · 600 · 900 · 1800 · 3600 · 7200 · 10800 · 14400 · 86400 | seconds | Bar duration in seconds: from 1 second (1) to 1 day (86400). Bars are counted from the product's session open (18:00 New York time for every current product): 4-hour bars start at 18:00, 22:00, 02:00 and so on, and a 1-day bar covers the whole session. |
Objects received
Each object keeps the same id from one update to the next. Its data is in the data field. Prices are in ticks: Prices and timestamps explains how to convert them.
An object sent in progress arrives with final: false, then again on every change, and each version fully replaces the previous one. Its description says when it ends: most objects end with a last version carrying final: true, and some are removed without one. An object sent final is sent once, with final: true.
Fields and units
Prices are in ticks (Prices and timestamps). Timestamps are nanoseconds since the Unix epoch, sent as strings: parse them as 64-bit integers. The fields below place the objects in time.
| Field | Unit | How to read it |
|---|---|---|
point.id | string · <barStartNs> | Start of the bar; the values hold at its close. Draw them as steps, each value from its bar’s start to the next one. |
point sent final
Values at the close of the bar.
id format: <barStartNs>.
| Field | Type | Unit | Present | Description |
|---|---|---|---|---|
lower1 | number | ticks | sometimes | Band −1. |
lower2 | number | ticks | sometimes | Band −2. |
lower3 | number | ticks | sometimes | Band −3. |
upper1 | number | ticks | sometimes | Band +1: VWAP + first standard deviations (or first% of the VWAP with price-percentage: 0.25% of a 20,000-point VWAP is 50 points). |
upper2 | number | ticks | sometimes | Band +2 (second multiplier). |
upper3 | number | ticks | sometimes | Band +3 (third multiplier). |
vwap | number | ticks | sometimes | VWAP; like the bands, absent when the value is undefined. |
Example messages
Messages as the WebSocket sends them to the subscription above, taken from a real NQ session. Historical data returns the same objects, with the same cursor, without the sub field.
The params of the subscription above are the current NQ ticker defaults, written out in full.
{
"sub": "vwap-bands",
"cursor": "20720.0.0",
"t": "upsert",
"id": "1790207700000000000",
"final": true,
"ts": "1790208000058746563",
"data": {
"vwap": 123131.51652638063,
"upper1": 123195.01381482669,
"lower1": 123068.01923793457,
"upper2": 123258.51110327273,
"lower2": 123004.52194948852,
"upper3": 123322.00839171879,
"lower3": 122941.02466104247
}
}JSON schemas
To validate or type your data: the JSON schemas of the parameters and of data, also available from GET /v1/indicators. The SDKs can generate types from them. Rules that compare two parameters, such as a maximum of at least its minimum, and the two decimals of decimal parameters, are only in the parameter descriptions: the API checks them too.
Parameters schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://fathomcharts.com/schemas/vwap-bands/params.json",
"type": "object",
"additionalProperties": false,
"properties": {
"envelopeMode": {
"description": "Bands in standard deviations (`standard-deviation`) or as a percentage of the VWAP (`price-percentage`).",
"type": "string",
"default": "standard-deviation",
"enum": [
"standard-deviation",
"price-percentage"
]
},
"first": {
"description": "Distance of band 1 from the VWAP, from 0.01 to 10, with at most two decimals: in standard deviations (`1.5`), or in percent of the VWAP with `price-percentage` (`0.25` = 0.25%).",
"type": "number",
"default": 1,
"minimum": 0.01,
"maximum": 10
},
"periodMode": {
"description": "Session VWAP (`daily`) or rolling over `periodValue` bars (`bars`).",
"type": "string",
"default": "daily",
"enum": [
"daily",
"bars"
]
},
"periodValue": {
"description": "Number of bars in the rolling window with `bars`; must be 1 with `daily`.",
"type": "integer",
"default": 1,
"minimum": 1,
"maximum": 10000
},
"second": {
"description": "Distance of band 2 from the VWAP, in the same unit, from 0.01 to 10, with at most two decimals.",
"type": "number",
"default": 2,
"minimum": 0.01,
"maximum": 10
},
"third": {
"description": "Distance of band 3 from the VWAP, in the same unit, from 0.01 to 10, with at most two decimals.",
"type": "number",
"default": 3,
"minimum": 0.01,
"maximum": 10
},
"timeframe": {
"description": "Bar duration in seconds: from 1 second (`1`) to 1 day (`86400`). Bars are counted from the product's session open (18:00 New York time for every current product): 4-hour bars start at 18:00, 22:00, 02:00 and so on, and a 1-day bar covers the whole session.",
"type": "integer",
"default": 300,
"enum": [
1,
5,
10,
15,
30,
60,
120,
180,
300,
600,
900,
1800,
3600,
7200,
10800,
14400,
86400
]
}
},
"allOf": [
{
"description": "must be 1 in `daily` mode",
"if": {
"properties": {
"periodMode": {
"const": "daily"
}
}
},
"then": {
"properties": {
"periodValue": {
"const": 1
}
}
}
}
]
}data field schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://fathomcharts.com/schemas/vwap-bands/data.json",
"title": "point",
"type": "object",
"additionalProperties": false,
"properties": {
"lower1": {
"description": "Band −1.",
"type": "number"
},
"lower2": {
"description": "Band −2.",
"type": "number"
},
"lower3": {
"description": "Band −3.",
"type": "number"
},
"upper1": {
"description": "Band +1: VWAP + `first` standard deviations (or `first`% of the VWAP with `price-percentage`: 0.25% of a 20,000-point VWAP is 50 points).",
"type": "number"
},
"upper2": {
"description": "Band +2 (`second` multiplier).",
"type": "number"
},
"upper3": {
"description": "Band +3 (`third` multiplier).",
"type": "number"
},
"vwap": {
"description": "VWAP; like the bands, absent when the value is undefined.",
"type": "number"
}
},
"required": []
}