Skip to main content

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.

TradeScript BTCUSDT 15m chart in the light theme with the green 24h live session badge rendered beside the OHLCV quote row above the chart

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:

StateSource dataLabel behaviorFallbackVerify with
Pre-marketResolved session schedule and current timeDistinct pre-market label; never reuse "Open"Closed treatment when no schedule resolvesTimestamp before regular open
OpenSchedule plus live data statusOpen/live treatmentUnknown/offline treatment when dataStatus is missingTimestamp inside regular session
Halted or auctionHost status section or typed venue stateExplicit status label and accessible text, not color aloneSchedule-derived state when no venue state is suppliedInject the venue state
Post-marketSchedule and selected session modeDistinct post-market labelClosed treatment when the session mode excludes extended hoursTimestamp after regular close
ClosedSchedule/calendarClosed plus next session when knownClosed without next-session text when the calendar is unavailableWeekend or calendar closure
Unknown/offlineMissing schedule or dataStatusExplain unavailable/delayed dataThis row is the fallback for every other stateRemove 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

NeedTradeScript surface
Symbol timezoneSymbolInfo.timezone
Exchange/session stringSymbolInfo.exchange, listedExchange, session
Structured sessionsSymbolInfo.sessionSchedule
Data delay/offline stateSymbolInfo.dataStatus
Runtime session infoMarketDataFeed.resolveSessionInfo, subscribeSessionInfo
Session calendarresolveSessionCalendar and session schedule providers
Custom status rows and popupLegendSettings.statusSections with showMarketStatus: true
Disable built-in status UIlegend.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.

  • 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.