Resolution
Overview
Resolution or time interval is a time period of a single bar. Changing the resolution allows users to switch between different levels of detail, from short-term intraday moves to long-term historical trends.
This article explains how to:
- Specify resolutions in the correct format.
- Set up the default resolution for the chart.
- Change the resolution in the UI or using the API.
- Understand how the library aligns bars on different resolutions.
- Adjust additional settings, such as disabling resolution changes or enabling custom resolutions.
For more information on how to configure resolutions on the datafeed side, see Configure resolutions in datafeed.
Resolution format
The library supports resolutions in seconds, minutes, hours, days, weeks, months, years, and ticks.
A resolution value should have the ResolutionString type.
The table below describes how to specify different resolution values. In these values, x represents a number of units.
| Resolution | Format | Example |
|---|---|---|
| Ticks | xT | 1T — one tick, 5T — five ticks, 100T — one hundred ticks |
| Seconds | xS | 1S — one second, 2S — two seconds, 100S — one hundred seconds |
| Minutes | x | 1 — one minute, 2 — two minutes, 100 — one hundred minutes |
| Hours | x minutes | 60 — one hour, 120 — two hours, 240 — four hours |
| Days | xD | 1D — one day, 2D — two days, 100D — one hundred days |
| Weeks | xW | 1W — one week, 2W — two weeks, 100W — one hundred weeks |
| Months | xM | 1M — one month, 2M — two months, 100M — one hundred months |
| Years | xM months | 12M — one year, 24M — two years, 48M — four years |
You can also omit the number of units if it is equal to 1. For example, you can use D instead of 1D and W instead of 1W.
Set up resolution on the chart
The resolution is initialized in the Widget Constructor and can be changed in the UI or using the API.
To get the current resolution, use the resolution method.
widget.onChartReady(() => {
widget.activeChart().resolution();
});
Default resolution
You can specify the default resolution using the interval property in the Widget Constructor.
new TradingView.widget({
// ...
interval: '1D',
});
In UI
Users can change the resolution in the following ways:
-
Use the Resolution button on the top toolbar.
-
Use the Resolution button in the Legend.
-
Press any digit key or the , (comma) key.
To disable any of the methods above, refer to Disable resolution changing.
Using API
You can use the setResolution method to change the resolution on the fly.
widget.onChartReady(() => {
widget.activeChart().setResolution('2M');
});
In the UI, users can enter values like 2h to specify a number of hours. However, you should specify hour resolutions in minutes, for example 120, if you change the resolution using the API.
Bar alignment
The library does not always display bar times exactly as your datafeed provides them. Instead, it aligns every bar to the start of the period this bar belongs to, as described in Library shifts bar time.
For resolutions that span several days, weeks, or months (for example, 3D, 2W, or 3M), the library counts periods from the beginning of the year:
- Days. The count starts on January 1. For symbols whose
sessionhas non-trading days, such as weekends and holidays, only trading days are counted. For24x7symbols, all calendar days are counted. - Weeks. The count starts on the first day of the first full week of the year. The days that precede this week belong to the last bar of the previous year.
- Months. The count starts in January.
The count restarts every year, therefore a period at the year boundary can be shorter than the resolution.
For example, on the 3D resolution, the bar that follows 2022-12-30 is 2023-01-01, not 2023-01-02.
The same rules apply to the future dates that the library extrapolates on the time scale.
The beginning of the year is the only supported anchor, and it cannot be configured.
If you want the chart to display bar times exactly as your datafeed provides them, use the disable_resolution_rebuild featureset described below.
Example
Consider a 24x7 symbol on the 3D resolution.
The datafeed provides bars for August 19, 22, 25, 28, and 31, 2025, but the chart displays each bar at the start of the three-day period this bar falls into.
| Time provided by the datafeed | Time displayed on the chart |
|---|---|
| 2025-08-19 | 2025-08-17 |
| 2025-08-22 | 2025-08-20 |
| 2025-08-25 | 2025-08-23 |
| 2025-08-28 | 2025-08-26 |
| 2025-08-31 | 2025-08-29 |
For instance, August 28, 2025 is the 240th day of the year, therefore its zero-based index is 239.
The library calculates the index of the period start as floor(239 / 3) * 3 = 237, which corresponds to the 238th day of the year — August 26.
Additional settings
You can use featuresets to adjust resolution settings.
Disable resolution rebuilding
The library aligns bars to the nearest expected bar position. For example, if session is 0915-1530 and the chart shows a 5-minute resolution, the library expects the following bar timestamps: [09:15, 09:20, 09:25, ...].
If your datafeed provides a bar with the 09:17 timestamp, the library changes this timestamp to 09:15.
You can use the disable_resolution_rebuild featureset to display bars exactly as your datafeed provides.
If you enable the disable_resolution_rebuild featureset, the library cannot build resolutions that your datafeed does not explicitly provide. For example, the library cannot build a 5-minute resolution from 1-minute data.
Enable custom resolutions
Users can add their custom resolutions in the UI. To allow this feature, do the following:
-
Enable the
custom_resolutionsfeatureset that displays the corresponding button in the UI. -
Specify the list of resolutions that the certain symbol supports in the
LibrarySymbolInfo.supported_resolutionsproperty. Users can add any resolution, but it will be disabled if it is not included in this list. -
To let users add custom resolutions in seconds or ticks, also enable the
seconds_resolutionortick_resolutionfeatureset. The Type dropdown in the Add custom interval dialog only offers these units when the corresponding featureset is enabled.
Note that you do not need to provide data for every resolution you want to support. The library can build additional resolutions from the available data. Make sure to specify a list of resolutions that your datafeed provides in the *_multipliers properties (seconds_multipliers, daily_multipliers, etc.).
Example
The default list of resolutions for the chart is specified in the DatafeedConfiguration.supported_resolutions property. It includes 1-minute, 2-minute, and 5-minute resolutions. These resolutions will be displayed for all symbols, even if a certain symbol does not support them.
// DatafeedConfiguration object
{
//...
supported_resolutions = ["1", "2", "5"]; // Resolutions displayed in the list by default
};
AAPL supports 1-minute, 5-minute, and 6-minute resolutions, as specified in LibrarySymbolInfo.supported_resolutions.
The symbol does not support 2-minute resolution, therefore, it will be disabled in the UI. The 6-minute resolution is not displayed by default, but it will be available if users add it manually.
// LibrarySymbolInfo object for AAPL
{
"has_intraday": true,
"supported_resolutions": ["1", "5", "6"], // Resolutions that the symbol supports
"intraday_multipliers": ["1"], // Resolutions that your datafeed provides
//...
}
If users enter an unsupported resolution such as 10 minutes, it will still appear in the list but will be disabled.
Disable resolution changing
You can use the header_resolutions featureset to remove the Resolution button from the top toolbar.
To disable resolution changing in the Legend, use the legend_inplace_edit featureset.
If you want to completely remove the Resolution button from the Legend, use the hide_resolution_in_legend featureset.

To disable the Resolution shortcut, use the show_interval_dialog_on_key_press featureset.