Fathom VWAP
Keep price in perspective. VWAP and its bands show where the market sits against everything traded this session.
VWAP computed from the levels of closed bars, reset every session (daily) or rolling over periodValue bars (bars), surrounded by bands in standard deviations or in percent. One final point per closed bar, except the first bar of the week, where the computation starts.
- Identifier
vwap-bands- Objects received
point- Calculation
- Since the start of the week
- Historical cost
- 1 unit per trade
Subscribe
The same params work in real time, on historical data and in exports. Any you leave out take their default value.
{
"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, the subscription counts as a custom configuration. A new value may require preparing a new calculation (status warming).
| Parameter | Type | Default | Allowed values | Unit | Description |
|---|---|---|---|---|---|
envelopeMode | choice | standard-deviation | standard-deviation · price-percentage | — | Bands in standard deviations or as a percentage of the VWAP. |
first | integer | 1 | 1 to 10 | — | Band 1 multiplier. |
periodMode | choice | daily | daily · bars | — | Session VWAP (daily) or rolling over periodValue bars (bars). |
periodValue | integer | 1 | 1 to 10,000 | bars | Bars in the rolling window; 1 in daily mode. |
second | integer | 2 | 1 to 10 | — | Band 2 multiplier. |
third | integer | 3 | 1 to 10 | — | Band 3 multiplier. |
timeframe | integer | 300 | 15 · 60 · 300 | — | Bar duration in seconds: 15, 60 or 300. |
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: multiply them by the instrument’s tick size (GET /v1/instruments) to get points.
point sent complete
Values at the close of the bar.
Format of the id: <barStartNs>. Each object is sent once, already complete (final: true).
| 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 deviations. |
upper2 | number | ticks | sometimes | Band +2 (second multiplier). |
upper3 | number | ticks | sometimes | Band +3 (third multiplier). |
vwap | number | ticks | sometimes | VWAP. |
Calculation warm-up
The calculation starts over at the beginning of every week (Saturday 00:00 UTC). During the weekend close it keeps the state of the past week; objects still open are finalized on the first trade of the new week. If nobody is using your parameters yet, the server first recomputes the week since its start (status warming), then goes live (status live).
Historical data follows the same rules: a query over a past period returns exactly what the real-time stream published.
Example messages
Messages received with the subscription parameters above. Over WebSocket, each message also carries sub and cursor.
{
"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 SDK can generate types from them.
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": {
"type": "string",
"default": "standard-deviation",
"enum": [
"standard-deviation",
"price-percentage"
],
"description": "Bands in standard deviations or as a percentage of the VWAP."
},
"first": {
"type": "integer",
"default": 1,
"minimum": 1,
"maximum": 10,
"description": "Band 1 multiplier."
},
"periodMode": {
"type": "string",
"default": "daily",
"enum": [
"daily",
"bars"
],
"description": "Session VWAP (`daily`) or rolling over `periodValue` bars (`bars`)."
},
"periodValue": {
"type": "integer",
"default": 1,
"minimum": 1,
"maximum": 10000,
"description": "Bars in the rolling window; 1 in `daily` mode."
},
"second": {
"type": "integer",
"default": 2,
"minimum": 1,
"maximum": 10,
"description": "Band 2 multiplier."
},
"third": {
"type": "integer",
"default": 3,
"minimum": 1,
"maximum": 10,
"description": "Band 3 multiplier."
},
"timeframe": {
"type": "integer",
"default": 300,
"enum": [
15,
60,
300
],
"description": "Bar duration in seconds: 15, 60 or 300."
}
}
}Schema of the data field
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://fathomcharts.com/schemas/vwap-bands/data.json",
"title": "point",
"type": "object",
"additionalProperties": false,
"required": [],
"properties": {
"lower1": {
"type": "number",
"description": "Band −1."
},
"lower2": {
"type": "number",
"description": "Band −2."
},
"lower3": {
"type": "number",
"description": "Band −3."
},
"upper1": {
"type": "number",
"description": "Band +1: VWAP + `first` deviations."
},
"upper2": {
"type": "number",
"description": "Band +2 (`second` multiplier)."
},
"upper3": {
"type": "number",
"description": "Band +3 (`third` multiplier)."
},
"vwap": {
"type": "number",
"description": "VWAP."
}
}
}