Indicator

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.

Subscribe message
{
  "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).

ParameterTypeDefaultAllowed valuesUnitDescription
envelopeModechoicestandard-deviationstandard-deviation · price-percentage—Bands in standard deviations or as a percentage of the VWAP.
firstinteger11 to 10—Band 1 multiplier.
periodModechoicedailydaily · bars—Session VWAP (daily) or rolling over periodValue bars (bars).
periodValueinteger11 to 10,000barsBars in the rolling window; 1 in daily mode.
secondinteger21 to 10—Band 2 multiplier.
thirdinteger31 to 10—Band 3 multiplier.
timeframeinteger30015 · 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).

FieldTypeUnitPresentDescription
lower1numbertickssometimesBand −1.
lower2numbertickssometimesBand −2.
lower3numbertickssometimesBand −3.
upper1numbertickssometimesBand +1: VWAP + first deviations.
upper2numbertickssometimesBand +2 (second multiplier).
upper3numbertickssometimesBand +3 (third multiplier).
vwapnumbertickssometimesVWAP.

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.

Final version
{
  "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
JSON
{
  "$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
JSON
{
  "$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."
    }
  }
}