Resolutions
The timeframe contract — bar widths from one second to one month, expressed as compact strings.
A resolution (or "timeframe") is the bar width — how many seconds
of price movement each bar covers. ChartForge expresses resolutions
as compact strings ('1s', '15m', '4h', '1d', '1M') so
they round-trip cleanly through URLs, JSON, and humans.
Quick example
How it works
Resolutions are strings of the form <number><unit>. Units:
s— secondsm— minutesh— hoursD(ord) — daysW(orw) — weeksM— months
The resolution flows through three layers:
- The host app sets
<EliteChart timeframe="..." />or callsuseChartStore.setTimeframe(...). - Internally, the resolution is parsed into seconds via the
parseResolution()helper (re-exported from@elitechart/elitechart). - The datafeed receives the original string in
getBarsandsubscribeso it can use whatever native representation the backend prefers.
Default selector
The top-bar resolution selector exposes:
1s · 5s · 15s · 1m · 5m · 15m · 30m · 1h · 4h · 1D · 1W · 1M
Custom values are accepted at the prop / store level — the selector just doesn't display unknown values. For a custom selector list, see recipes/customize-toolbar.
Variations
Lock the resolution
Drive from a URL parameter
API
| Symbol | From | Type |
|---|---|---|
Resolution | @elitechart/elitechart | string literal pattern |
parseResolution(s) | @elitechart/elitechart | (s: string) => number (seconds) |
formatResolution(secs) | @elitechart/elitechart | (n: number) => string |