Market Status
Market status is the badge and status rows that tell users whether the active symbol is tradable right now. It is driven by symbol metadata, session schedules, data status, and session calendars — the UI renders state; session truth belongs to symbol and datafeed contracts.

State shown: a continuously trading crypto symbol (BTCUSDT) with the green "24h live" session badge beside the quote row, light theme.
State contract
Each state defines its source data, label/color behavior, fallback, and a condition you can use to verify the integration:
| State | Source data | Label behavior | Fallback | Verify with |
|---|---|---|---|---|
| Pre-market | Resolved session schedule and current time | Distinct pre-market label; never reuse "Open" | Closed treatment when no schedule resolves | Timestamp before regular open |
| Open | Schedule plus live data status | Open/live treatment | Unknown/offline treatment when dataStatus is missing | Timestamp inside regular session |
| Halted or auction | Host status section or typed venue state | Explicit status label and accessible text, not color alone | Schedule-derived state when no venue state is supplied | Inject the venue state |
| Post-market | Schedule and selected session mode | Distinct post-market label | Closed treatment when the session mode excludes extended hours | Timestamp after regular close |
| Closed | Schedule/calendar | Closed plus next session when known | Closed without next-session text when the calendar is unavailable | Weekend or calendar closure |
| Unknown/offline | Missing schedule or dataStatus | Explain unavailable/delayed data | This row is the fallback for every other state | Remove schedule or simulate offline data |
Two visible treatments carry the state:
- A compact colored badge beside the quote row — the 24h badge above — carrying the summary state.
- Optional host-defined status rows in the legend, which can open a detail popup with session timeline segments.
Data sources
| Need | TradeScript surface |
|---|---|
| Symbol timezone | SymbolInfo.timezone |
| Exchange/session string | SymbolInfo.exchange, listedExchange, session |
| Structured sessions | SymbolInfo.sessionSchedule |
| Data delay/offline state | SymbolInfo.dataStatus |
| Runtime session info | MarketDataFeed.resolveSessionInfo, subscribeSessionInfo |
| Session calendar | resolveSessionCalendar and session schedule providers |
| Custom status rows and popup | LegendSettings.statusSections with showMarketStatus: true |
| Disable built-in status UI | legend.visible: false / showMarketStatus: false |
Schedule and timezone ownership: the datafeed owns session truth through SymbolInfo and the session-info contracts; the chart owns only presentation. See Session Schedules, Session Filtering, and Session Info.
Status presentation
Support the current session/status contracts, compact custom market-status rows, and host-defined status popups. Host rows live in legend settings; session truth still belongs to symbol/datafeed contracts.
LegendSettings.statusSections covers compact legend and status rows carrying a label, value, status, color, symbol, timestamp, and metadata.
The status value may be a built-in market state or a host-defined status id such as auction-imbalance. Provide color when a custom status needs a specific visual treatment.
Rows can also define icon, tooltip, description, details, action, and timeline segments. The built-in legend opens a status popup for them and routes action buttons through the same chart.customization().registerAction(...) registry used by toolbar and context-menu actions.
chart.customization().setLegend({
showMarketStatus: true,
statusSections: [{
id: 'venue-imbalance',
label: 'Venue',
status: 'auction-imbalance',
value: 'Auction imbalance',
color: '#38bdf8',
icon: 'clock',
tooltip: 'Opening auction imbalance',
description: 'The venue is publishing pre-open imbalance data.',
details: [
{ label: 'Session', value: '16:00-20:00 ET' },
{ label: 'Data', value: 'Realtime', color: '#22c55e' },
],
action: { label: 'Session details', actionId: 'open-session-details' },
timeline: {
dayLabel: 'Venue day',
nowPct: 58,
segments: [
{ state: 'pre-open', label: 'Pre-open', startPct: 0, endPct: 20 },
{ state: 'continuous', label: 'Continuous', startPct: 20, endPct: 92 },
],
},
}],
});
Localization
Built-in popup copy uses the normal localization catalog. Override market_status_symbol, market_status_updated, market_status_session, market_status_details, and market_status_close_details through loadLocales(...) or LocalizationSettings.translations. Host-provided row labels, detail labels, values, descriptions, and action labels remain host-owned text.
Related pages
- Session Schedules — where structured session truth comes from.
- Session Info — the runtime session-info widget contracts.
- Legend — the surface that hosts status rows and the popup.