Stock chart data types

OHLCV, indicator, event, and runtime types used by StockChart.

Import
import type { OHLCVData } from "@sixtyfold/stock";

Use the public entry point shown above.

CandleStyle

Style for rendering price data

Import @sixtyfold/stocktype

type CandleStyle = "filled" | "hollow" | "ohlc"

KeyboardAnnouncementMessages

Localizable announcements emitted after keyboard chart actions.

Import @sixtyfold/stockinterface

interface KeyboardAnnouncementMessages
MemberDefinitionDescription
panLeft?string | undefinedPan left text.
panRight?string | undefinedPan right text.
reset?string | undefinedReset text.
selectionCancelled?string | undefinedSelection cancelled text.
viewport?string | undefinedOptional viewport context appended after a successful pan, zoom, or reset. The placeholders {startPercent}, {endPercent}, and {spanPercent} are replaced with positions relative to the complete data range. Set an empty string to announce only the action message.
zoomIn?string | undefinedZoom in text.
zoomOut?string | undefinedZoom out text.

OHLCVData

Six aligned ordered timestamp, OHLC, and volume columns.

Import @sixtyfold/stockinterface

interface OHLCVData
MemberDefinitionDescription
closeFloat64Array<ArrayBufferLike>Closing price column aligned by index with the OHLCV timestamps.
highFloat64Array<ArrayBufferLike>Upper bound values aligned by index with X and the matching lower-bound column.
lengthnumberNumber of active aligned rows to read from the supplied data columns.
lowFloat64Array<ArrayBufferLike>Lower bound values aligned by index with X and the matching upper-bound column.
openFloat64Array<ArrayBufferLike>Opening price column aligned by index with the OHLCV timestamps.
timestampFloat64Array<ArrayBufferLike>Unix timestamps (ms). Ascending and descending input are accepted.
volumeFloat64Array<ArrayBufferLike>Volume column aligned by index with the OHLCV timestamps and price columns.

OverlayErrorCallback

Called when an overlay update has one or more resolution or delivery failures.

Import @sixtyfold/stocktype

type OverlayErrorCallback = (error: ChartOverlayError) => void

RendererErrorCallback

Called once when the chart renderer fails and is about to be torn down.

Import @sixtyfold/stocktype

type RendererErrorCallback = (error: ChartRendererError) => void

RendererFailurePhase

Stage at which a chart renderer stopped working.

Import @sixtyfold/stocktype

type RendererFailurePhase = "initialization" | "runtime"

StockCandleBatch

One transferable aligned OHLCV column batch used during streaming installation.

Import @sixtyfold/stockinterface

interface StockCandleBatch
MemberDefinitionDescription
closeFloat64Array<ArrayBufferLike>Closing price column aligned by index with the OHLCV timestamps.
highFloat64Array<ArrayBufferLike>Upper bound values aligned by index with X and the matching lower-bound column.
lowFloat64Array<ArrayBufferLike>Lower bound values aligned by index with X and the matching upper-bound column.
openFloat64Array<ArrayBufferLike>Opening price column aligned by index with the OHLCV timestamps.
timestampFloat64Array<ArrayBufferLike>Timestamp in Unix epoch milliseconds. Keep it ordered with the other aligned columns.
volumeFloat64Array<ArrayBufferLike>Volume column aligned by index with the OHLCV timestamps and price columns.

StockChartStats

Renderer and aggregation telemetry for the active stock dataset and frame.

Import @sixtyfold/stockinterface

interface StockChartStats
MemberDefinitionDescription
aggregationstringAggregation text.
bufferUsagenumberBuffer usage value.
firstRenderTimestringFirst render time text.
fpsnumberFps value.
frameTimestringFrame time text.
lodBuiltnumberLOD built value.
lodLevelnumberLOD level value.
lodReadybooleanWhether to enable LOD ready.
lodTotalnumberLOD total value.
renderedCandlesnumberRendered candles value.
renderMode"worker" | "main"Selects the render mode.
ringBufferbooleanWhether to enable ring buffer.
totalCandlesnumberCount reported for total candles in the current stock chart stats snapshot.
totalReceivednumberCount reported for total received in the current stock chart stats snapshot.
visibleCandlesnumberVisible candles value.

StockCrosshairIndicatorValue

Fields for stock crosshair indicator value.

Import @sixtyfold/stockinterface

interface StockCrosshairIndicatorValue
MemberDefinitionDescription
colorstringStock crosshair indicator value color.
formattedValuestringFormatted value text.
idstringUnique identifier for this stock crosshair indicator value.
labelstringStock crosshair indicator value label.
valuenumberValue value.

StockCrosshairMoveDetail

Stock candle and derived values under the active crosshair.

Import @sixtyfold/stockinterface

interface StockCrosshairMoveDetail
MemberDefinitionDescription
bullishbooleanWhether to enable bullish.
candle{ open: number; high: number; low: number; close: number; volume: number; }Raw OHLCV values for the selected candle before display formatting.
changenumberChange value.
changePercentnumberRatio used for change; consult the accepted range in the parent configuration.
colorstringStock crosshair move detail color.
formatted{ open: string; high: string; low: string; close: string; volume: string; }Display-ready strings for the selected candle, after the configured units and bounded precision are applied.
formattedChangestringFormatted change text.
indicators?StockCrosshairIndicatorValue[] | undefinedIndicator configurations or computed indicator values associated with stock crosshair move detail; order is preserved for rendering and tooltip display.
screenXnumberScreen X value.
screenYnumberScreen Y value.
timestampnumberTimestamp in Unix epoch milliseconds. Keep it ordered with the other aligned columns.

StockIndicator

Declarative stock indicator configuration.

Import @sixtyfold/stocktype

type StockIndicator = SMAIndicatorConfig | EMAIndicatorConfig | BollingerBandsIndicatorConfig | VWAPIndicatorConfig

StockIndicatorLineDash

Accepted values for stock indicator line dash.

Import @sixtyfold/stocktype

type StockIndicatorLineDash = "solid" | "dashed" | "dotted"

StockMarkerPosition

Vertical anchor used when positioning a stock marker.

Import @sixtyfold/stocktype

type StockMarkerPosition = "above" | "below" | "price"

StockMarkerShape

Glyphs supported by data-anchored stock markers.

Import @sixtyfold/stocktype

type StockMarkerShape = "circle" | "square" | "diamond" | "triangle-up" | "triangle-down"

StockPriceSource

Price column or derived price used as indicator input.

Import @sixtyfold/stocktype

type StockPriceSource = "open" | "high" | "low" | "close" | "hl2" | "hlc3" | "ohlc4"

StockTimeScale

Continuous elapsed-time positioning or compressed observed-market positioning.

Import @sixtyfold/stocktype

type StockTimeScale = "continuous" | "market"

StockTooltipFieldLabels

Accepted values for stock tooltip field labels.

Import @sixtyfold/stocktype

type StockTooltipFieldLabels = Partial<Record<StockTooltipField, string>>
MemberDefinitionDescription
change?string | undefinedText shown for the change label.
changePercent?string | undefinedText shown for the changePercent label.
close?string | undefinedText shown for the close label.
high?string | undefinedText shown for the high label.
low?string | undefinedText shown for the low label.
open?string | undefinedText shown for the open label.
volume?string | undefinedText shown for the volume label.

StockVisibleRangeChangeDetail

Renderer-synchronized visible X range and complete data extent.

Import @sixtyfold/stockinterface

interface StockVisibleRangeChangeDetail
MemberDefinitionDescription
dataBounds{ xMin: number; xMax: number; }Complete installed-data extent for stock visible range change detail, expressed in the chart's X units.
viewport{ xMin: number; xMax: number; }Current visible X-domain extent for stock visible range change detail, expressed in the chart's X units.

TimeRange

A supported stock viewport preset identifier.

Import @sixtyfold/stocktype

type TimeRange = (typeof STOCK_TIME_RANGES)[number]

TimeRangeChangeDetail

Payload for the time range change event.

Import @sixtyfold/stockinterface

interface TimeRangeChangeDetail
MemberDefinitionDescription
previousRange"1D" | "5D" | "1M" | "3M" | "6M" | "YTD" | "1Y" | "5Y" | "ALL" | nullPreviously applied stock time-range preset, or null when no concrete preset matched the viewport.
range"1D" | "5D" | "1M" | "3M" | "6M" | "YTD" | "1Y" | "5Y" | "ALL" | nullApplied stock time-range preset, or null when no concrete preset matched the viewport.
sourceTimeRangeChangeSourceSelects the source value used to calculate or render time range change detail.

VWAPReset

Accepted values for VWAP reset.

Import @sixtyfold/stocktype

type VWAPReset = "day" | "week" | "none"