# Session Volume Profile

## Overview

**Session Volume Profile** shows how traded volume was distributed across price levels within each trading session.
Every session is drawn as a horizontal histogram with its _Point of Control_ (POC) — the price level with the highest traded volume — and its _Value Area_, the price range that contains the specified share of the session volume.

Unlike Volume Profile Visible Range and Volume Profile Fixed Range, which build a single profile for the visible or selected range, Session Volume Profile splits history into sessions and builds a separate profile for each of them.

![Session Volume Profile](https://charting-library-docs.xstaging.tv/img/session-volume-profile.png)

Session Volume Profile is available in two forms that use the same calculation. They differ in where the settings live and in how the custom session time zone is resolved:

| | Chart type | Indicator |
| --- | --- | --- |
| Settings dialog | _Settings_ | _Indicator settings_ |
| Customization | [`mainSeriesProperties.svpStyle`](https://charting-library-docs.xstaging.tv/latest/customization/overrides/chart-overrides.md#chart-styles) overrides | [Indicator overrides](https://charting-library-docs.xstaging.tv/latest/customization/overrides/indicator-overrides.md) |
| Custom session time zone | The chart time zone | The `Custom session timezone` input |

### Chart type

Session Volume Profile is [`SeriesType.SVP`](https://charting-library-docs.xstaging.tv/latest/api/enums/Charting_Library.SeriesType) with the numeric value `20`. Users select it in the chart type menu; you can set it programmatically or through [`overrides`](https://charting-library-docs.xstaging.tv/latest/api/interfaces/Charting_Library.ChartingLibraryWidgetOptions#overrides).

```javascript
widget.activeChart().setChartType(20);
```

When Session Volume Profile is the chart type, the chart displays profiles only: the price bars of the main series are not drawn.

### Indicator

Session Volume Profile is added like any other [indicator](https://charting-library-docs.xstaging.tv/latest/ui_elements/indicators.md) — from the _Indicators_ dialog or with [`createStudy`](https://charting-library-docs.xstaging.tv/latest/api/interfaces/Charting_Library.IChartWidgetApi#createstudy). The indicator is displayed on top of the current chart type.

```javascript
widget.activeChart().createStudy('Session Volume Profile', false);
```

## Inputs

| Input | Default | Values |
| --- | --- | --- |
| Sessions | `All` | `All`, `Each (pre-market, market, post-market)`, `Pre-market only`, `Market only`, `Post-market only`, `Custom` |
| Custom session | `0930-1600` | A session in the `HHMM-HHMM` or `HHMM-HHMM:days` format |
| Custom session timezone | `Exchange` | The exchange time zone or a named time zone. Available in the indicator only |
| Volume | `Up/Down` | `Up/Down`, `Total`, `Delta` |
| Value Area Volume | `70` | `0`–`100`. The share of the profile volume that forms the Value Area, in percent |
| Rows Layout | `Number Of Rows` | `Number Of Rows`, `Ticks Per Row` |
| Row Size | `24` | `1`–`1000000`. A row count or a number of ticks per row, depending on `Rows Layout` |
| Extend POC Right | `false` | Extends the Point of Control line to the right of its session |
| Extend VAH Right | `false` | Extends the Value Area High line to the right of its session |
| Extend VAL Right | `false` | Extends the Value Area Low line to the right of its session |

`All` builds one profile per trading day. `Each (pre-market, market, post-market)` and the three single-phase values build one profile per session phase and require a symbol with pre-market and post-market subsessions. On a symbol without them, every in-session bar counts as market hours. `Custom` builds one profile per occurrence of the `Custom session` window.

Bars outside the selected session are not included in the profile.

A bar that spans several rows distributes its volume across them proportionally to the price overlap, so the bar's total volume is preserved instead of being assigned to a single row.

## Customization

The chart type exposes nine inputs and the appearance settings through the `mainSeriesProperties.svpStyle.*` [chart overrides](https://charting-library-docs.xstaging.tv/latest/customization/overrides/chart-overrides.md#chart-styles). You can apply them in [`overrides`](https://charting-library-docs.xstaging.tv/latest/api/interfaces/Charting_Library.ChartingLibraryWidgetOptions#overrides) or at runtime with [`setChartStyleProperties`](https://charting-library-docs.xstaging.tv/latest/api/interfaces/Charting_Library.ISeriesApi#setchartstyleproperties).

```javascript
widget.activeChart().getSeries().setChartStyleProperties(20, {
    inputs: { profilesSessions: 'Each (pre-market, market, post-market)', rows: 48 },
    poc: { visible: true, linewidth: 2 },
});
```

The indicator is customized through [`SessionVolumeProfileIndicatorOverrides`](https://charting-library-docs.xstaging.tv/latest/api/interfaces/Charting_Library.SessionVolumeProfileIndicatorOverrides).

## Datafeed requirements

### Volume

Session Volume Profile requires volume data. For a symbol whose bars carry no volume, the indicator reports an error.

### Supported resolutions

Session Volume Profile supports intraday resolutions and `1D`. On a coarser resolution, such as `2D`, weekly, or monthly, it reports an error and asks the user to switch to a lower one.

### Detailed data

To build an accurate profile, the indicator can request an additional series at a resolution finer than the chart. The request goes through the same [`getBars`](https://charting-library-docs.xstaging.tv/latest/api/interfaces/Charting_Library.IDatafeedChartApi#getbars) method as any other series, so your datafeed should either serve that resolution or reject it through `onErrorCallback`.

On time-based charts, the detailed resolution is selected as follows:

- If you implement [`getVolumeProfileResolutionForPeriod`](https://charting-library-docs.xstaging.tv/latest/connecting_data/datafeed-api/additional-methods.md#getvolumeprofileresolutionforperiod) and return a resolution finer than the chart resolution, your result is used. This is the recommended way to keep control over the request.
- Otherwise, the indicator picks the advertised resolution closest to its internal default without being coarser than that default. If no advertised resolution is that fine, it uses the finest advertised resolution that is still finer than the chart resolution.
   The list comes from the symbol's [`supported_resolutions`](https://charting-library-docs.xstaging.tv/latest/api/interfaces/Charting_Library.LibrarySymbolInfo#supported_resolutions), or from the [datafeed configuration](https://charting-library-docs.xstaging.tv/latest/connecting_data/datafeed-api/required-methods.md#onready) when the symbol does not provide its own. The [`has_seconds`](https://charting-library-docs.xstaging.tv/latest/api/interfaces/Charting_Library.LibrarySymbolInfo#has_seconds) and [`has_ticks`](https://charting-library-docs.xstaging.tv/latest/api/interfaces/Charting_Library.LibrarySymbolInfo#has_ticks) flags are respected for the seconds and ticks bands.
- If nothing finer is available, the profile is built from the chart's own bars.

Tick charts always use their displayed tick bars, because finer tick bars cannot be mapped completely to a displayed bar by timestamp.

## History and performance

By default, Session Volume Profile draws over the range that the chart itself has loaded: profiles stop where the chart history stops, and scrolling back loads more of them. There is no fixed recent-history window.
[`volume_profile`] of the [Widget Constructor](https://charting-library-docs.xstaging.tv/latest/configuration/Widget-Constructor.md) adjusts this behavior through the following properties.

### history_sessions

[`volume_profile.history_sessions`] sets how many trading sessions of history the indicator should initially cover.
It adds a minimum-history request that extends the chart history to fit those sessions. This is a prefetch floor rather than a limit: normal scroll-back remains available.

```javascript
enabled_features: ['studies_extend_time_scale'],
volume_profile: {
    history_sessions: 40,
},
```

Consider the following:

- The parameter requires the [`studies_extend_time_scale`] featureset. Without it, the parameter has no effect.
- The time scale is shared, so extending it affects every source on the chart, not only this indicator.
- Values below `1` are ignored, and values above `500` are clamped.
- As protection against amplified initial requests, the parameter contributes at most 200,000 bars to the minimum `countBack` of each affected series. Therefore, high-frequency data may cover fewer sessions than requested. Tick resolutions always use this 200,000-bar contribution, because a session duration cannot predict how many ticks it contains.

### max_total_rows

[`volume_profile.max_total_rows`] limits the total number of histogram rows that a volume profile indicator keeps across all profiles it has drawn. The default value is `6000`. Values below `100` are ignored.

Once new profiles would push Session Volume Profile past the limit, its oldest profiles are dropped. This is what bounds how far back the indicator draws.

Raising the limit lets profiles cover more history at the cost of memory and of the time spent serializing and laying out the extra rows. Increase it gradually and measure.

:::info

The parameter applies to every volume profile indicator, including Volume Profile Visible Range and Volume Profile Fixed Range. Since these indicators draw a single profile, they report an error instead of dropping profiles when their histogram exceeds the limit.

:::

[`studies_extend_time_scale`]: https://charting-library-docs.xstaging.tv/latest/customization/Featuresets.md#studies_extend_time_scale
[`volume_profile`]: https://charting-library-docs.xstaging.tv/latest/api/interfaces/Charting_Library.ChartingLibraryWidgetOptions#volume_profile
[`volume_profile.history_sessions`]: https://charting-library-docs.xstaging.tv/latest/api/interfaces/Charting_Library.VolumeProfileOptions#history_sessions
[`volume_profile.max_total_rows`]: https://charting-library-docs.xstaging.tv/latest/api/interfaces/Charting_Library.VolumeProfileOptions#max_total_rows

---

## Sitemap

- [All documentation pages](https://charting-library-docs.xstaging.tv/llms.txt)
- [Full page map with headings](https://charting-library-docs.xstaging.tv/docs_map.md)
