Stock chart options
StockChartOptions API. Configure candles, volume, indicators, ranges, labels, and market layers.
import type { StockChartOptions } from "@sixtyfold/stock";Usa el punto de entrada público indicado arriba. Las importaciones solo de tipos se eliminan del JavaScript de la aplicación.
BollingerBandsIndicatorConfig
Bollinger bands indicator options.
Import @sixtyfold/stock·interface
interface BollingerBandsIndicatorConfig extends StockIndicatorStyle| Member | Definition | Description |
|---|---|---|
color? | string | undefined | Bollinger bands indicator color. |
deviation? | number | undefined | Standard-deviation multiplier. Defaults to 2. |
fill | string | undefined | Fill color. |
fill | number | undefined | Fill opacity from 0 to 1. |
id? | string | undefined | Unique identifier for this bollinger bands indicator. |
include | boolean | undefined | Whether this layer affects automatic Y-axis scaling. |
label? | string | undefined | Bollinger bands indicator label. |
line | StockIndicatorLineDash | undefined | Canvas dash pattern in CSS pixels. |
line | number | undefined | Line width in CSS pixels. |
lower | string | undefined | Lower color. |
middle | string | undefined | Middle color. |
period | number | Lookback period in raw candles. |
source? | StockPriceSource | undefined | Defaults to close. |
type | "bollinger" | Selects the type. |
upper | string | undefined | Upper color. |
visible? | boolean | undefined | Whether to render the bollinger bands indicator. |
CandleColors
Candle colors.
Import @sixtyfold/stock·interface
interface CandleColorsEMAIndicatorConfig
EMA indicator options.
Import @sixtyfold/stock·interface
interface EMAIndicatorConfig extends StockIndicatorStyle| Member | Definition | Description |
|---|---|---|
color? | string | undefined | EMA indicator color. |
id? | string | undefined | Unique identifier for this EMA indicator. |
include | boolean | undefined | Whether this layer affects automatic Y-axis scaling. |
label? | string | undefined | EMA indicator label. |
line | StockIndicatorLineDash | undefined | Canvas dash pattern in CSS pixels. |
line | number | undefined | Line width in CSS pixels. |
period | number | Lookback period in raw candles. |
source? | StockPriceSource | undefined | Defaults to close. |
type | "ema" | Selects the type. |
visible? | boolean | undefined | Whether to render the EMA indicator. |
SMAIndicatorConfig
SMA indicator options.
Import @sixtyfold/stock·interface
interface SMAIndicatorConfig extends StockIndicatorStyle| Member | Definition | Description |
|---|---|---|
color? | string | undefined | SMA indicator color. |
id? | string | undefined | Unique identifier for this SMA indicator. |
include | boolean | undefined | Whether this layer affects automatic Y-axis scaling. |
label? | string | undefined | SMA indicator label. |
line | StockIndicatorLineDash | undefined | Canvas dash pattern in CSS pixels. |
line | number | undefined | Line width in CSS pixels. |
period | number | Lookback period in raw candles. |
source? | StockPriceSource | undefined | Defaults to close. |
type | "sma" | Selects the type. |
visible? | boolean | undefined | Whether to render the SMA indicator. |
StockAddCandlesOptions
Options for stock add candles.
Import @sixtyfold/stock·interface
interface StockAddCandlesOptionsStockAppearanceOptions
Stock chart appearance — base appearance + stock-specific visual fields
Import @sixtyfold/stock·interface
interface StockAppearanceOptions extends BaseAppearanceOptions| Member | Definition | Description |
|---|---|---|
axis? | AxisAppearanceOptions | undefined | Runtime appearance options for axis. |
candle | CandleColors | undefined | Colors used for candle bodies and wicks. |
candle | number | undefined | Candle outline and OHLC-bar width in CSS pixels. |
chart | BackgroundOptions | undefined | Runtime appearance options for chart background. |
crosshair | CrosshairOptions | undefined | Runtime appearance options for crosshair style. |
grid? | GridOptions | undefined | Runtime appearance options for grid. |
labels? | ChartLabels | undefined | Runtime appearance options for labels. |
overlay? | OverlayOptions | undefined | Runtime appearance options for overlay. |
padding? | PaddingOptions | undefined | Runtime appearance options for padding. |
preview | string | undefined | Line color used by the range-selector preview. |
range | RangeSelectorAppearanceOptions | undefined | Runtime appearance options for range selector. |
selection? | SelectionOptions | undefined | Runtime appearance options for selection. |
text | TextDirection | undefined | Runtime appearance options for text direction. |
tooltip? | TooltipOptions | undefined | Runtime appearance options for tooltip. |
StockChartOptions
Construction, interaction, appearance, range, and market-layer options for a stock chart.
Import @sixtyfold/stock·interface
interface StockChartOptions| Member | Definition | Description |
|---|---|---|
animated? | boolean | undefined | Animate data reveal and viewport/axis transitions. When omitted, animation is enabled unless the browser reports prefers-reduced-motion: reduce. |
axis? | AxisOptions | undefined | Axis customization (line color and label colors) |
candle | CandleColors | undefined | Custom colors for candles |
candle | number | undefined= 1 | Stroke width for candle outlines and OHLC bars |
candle | CandleStyle | undefined | Style for rendering price data: - 'filled': solid filled candles (default) - 'hollow': candles with stroke outline only - 'ohlc': classic OHLC bars with horizontal ticks |
chart | BackgroundOptions | undefined= #16213e | Chart background (covers entire canvas including preview area). Can be a solid color string, gradient definition, or image. |
crosshair | string | undefined | Legacy fallback color for left and right Y-axis cursor labels. Explicit axis cursor-label colors take precedence. |
crosshair | CrosshairOptions | undefined | Crosshair lines styling (vertical and horizontal guide lines) |
grid? | GridOptions | undefined | Grid line customization for main chart |
indicators? | StockIndicator[] | undefined | Built-in worker-rendered technical indicators. |
interactive? | boolean | undefined= true | Enable user interactions (pan/zoom/pinch). When false, chart is view-only but still shows crosshair/tooltip on hover. |
keep | number | undefined= 0 (disabled) | Keep-alive interval in seconds to prevent Safari from releasing GPU resources. Safari aggressively cleans up "unused" canvases, causing blank charts. |
keyboard | "focus" | "hover" | undefined | How keyboard controls become active. - "focus" (default): chart must have DOM focus - "hover": chart under the mouse pointer receives keyboard navigation |
keyboard | false | KeyboardAnnouncementMessages | undefined | Localize keyboard-action announcements for assistive technologies, or set false to disable them. Omitted messages use concise English defaults. |
keyboard | number | undefined= 0.1 (10%) | Keyboard pan speed (arrow keys). Fraction of visible range to pan per keypress.1 (10%) |
keyboard | number | undefined= 0.1 (10% per keypress) | Keyboard zoom speed (+/- keys). Higher values = faster zoom.1 (10% per keypress) |
labels? | ChartLabels | undefined | Text labels around the chart (title, axis labels) |
markers? | StockMarker[] | undefined | Sparse timestamp/price event markers. |
min | number | undefined | Smallest interactive X viewport span, expressed in the same units as the chart's X values. Invalid or non-positive values retain the chart-type default. This construction option is not part of mutable appearance. |
on | ((detail: StockCrosshairMoveDetail | null) => void) | undefined | Called as the crosshair moves between candles, and with null when it leaves. |
on | ((range: TimeRange | null) => void) | undefined | Called with the active preset, or null when the viewport no longer matches a named preset. |
on | ((detail: StockVisibleRangeChangeDetail) => void) | undefined | Called when the renderer reports a changed visible range or data extent. |
overlay? | OverlayOptions | undefined | Declarative overlay primitives rendered above chart content |
padding? | PaddingOptions | undefined= { top: 20, right: 80, bottom: 40, left: 80 } | Custom padding in pixels |
preview | string | undefined= #4a90d9 | Color for the preview line in range selector |
price | StockPriceLine[] | undefined | Horizontal data-anchored price levels. |
price | UnitOptions | undefined | Unit config for price values (OHLC) in tooltip and axis labels |
range | RangeSelectorOptions | undefined | Range selector (preview chart) configuration |
renderer | number | undefined= 15000 | Maximum time in milliseconds allowed for renderer startup. The watchdog starts during chart construction, so it also protects applications that do not await BaseChart.initialize. Set to 0 to disable it. |
render | "auto" | "worker" | "main" | undefined | Selecciona el modo de renderizado. auto prefiere Worker + OffscreenCanvas; worker fuerza el worker con respaldo en el hilo principal; main renderiza en el hilo principal del navegador y requiere DOM. |
selection? | SelectionOptions | undefined | Selection range (drag-to-zoom) styling |
show | boolean | undefined | Alias for showLeftAxisLabel - show price marker on left Y-axis |
show | boolean | undefined | Alias for showRightAxisLabel - show price marker on right Y-axis |
show | boolean | undefined | Whether to show volume. |
text | TextDirection | undefined= inherit | Direction used for Canvas2D text. Use "auto" to infer from the first strong character of each string, or "rtl"/"ltr" to force a chart-wide direction. |
time | StockTimeScale | undefined | X-axis behavior. market compresses intervals without observations while preserving real timestamps in labels and events. |
tooltip? | StockTooltipOptions | undefined | Tooltip options with stock-specific onRender params |
volume | VolumeColors | undefined | Custom colors for volume bars (defaults to candle colors) |
volume | number | undefined= 0.15 | Height of volume area as fraction of chart height (0-1,15) |
volume | number | undefined= 0.35 | Opacity of volume bars (0-1,35) |
volume | false | VolumeProfileOptions | undefined | Estimated candle-derived visible-range volume-by-price profile, or false to disable it. |
volume | UnitOptions | undefined | Unit config for volume values in tooltip |
wheel | "up-in" | "up-out" | undefined | Mouse wheel zoom direction. - "up-in" (default): wheel up/backward zooms in, wheel down/forward zooms out - "up-out": wheel up/backward zooms out, wheel down/forward zooms in |
wheel | number | undefined= 0.1 (10% per wheel tick) | Mouse wheel zoom speed. Higher values = faster zoom.1 (10% per wheel tick) |
y | YDomainOptions | undefined | Pin either or both edges of the rendered Y domain. Omitted edges continue to auto-scale from visible data. Supplying both finite edges keeps the Y viewport stable across zoom, LOD selection, and streaming updates. The option is disabled by default and is construction configuration rather than mutable appearance. |
StockChartStatsOptions
Controls how frequently stock telemetry is published.
Import @sixtyfold/stock·interface
interface StockChartStatsOptionsStockIndicatorStyle
Renderer-facing metadata shared by all indicators. Calculations ignore it.
Import @sixtyfold/stock·interface
interface StockIndicatorStyle| Member | Definition | Description |
|---|---|---|
color? | string | undefined | Stock indicator style color. |
id? | string | undefined | Unique identifier for this stock indicator style. |
include | boolean | undefined | Whether this layer affects automatic Y-axis scaling. |
label? | string | undefined | Stock indicator style label. |
line | StockIndicatorLineDash | undefined | Canvas dash pattern in CSS pixels. |
line | number | undefined | Line width in CSS pixels. |
visible? | boolean | undefined | Whether to render the stock indicator style. |
StockMarker
A sparse event/trade marker anchored to a timestamp and optionally a price.
Import @sixtyfold/stock·interface
interface StockMarker| Member | Definition | Description |
|---|---|---|
color? | string | undefined | Marker fill color. |
id? | string | undefined | Identificador opcional, estable y definido por la aplicación, conservado con el marcador. |
label? | string | undefined | Optional short marker label. |
position? | StockMarkerPosition | undefined | Place above/below the nearest candle or at an explicit price. |
price? | number | undefined | Explicit price anchor. Required when position is price. |
shape? | StockMarkerShape | undefined | Marker glyph. |
size? | number | undefined | Marker radius/half-size in CSS pixels. |
text | string | undefined | Marker label color. |
timestamp | number | Marker timestamp, in the same units as the chart data. |
StockPriceLine
A horizontal, data-anchored price level rendered over the stock chart.
Import @sixtyfold/stock·interface
interface StockPriceLineStockTooltipOptions
Tooltip options for stock charts - overrides onRender with stock-specific params
Import @sixtyfold/stock·interface
interface StockTooltipOptions extends Omit<TooltipOptions, "onRender">VolumeColors
Volume colors.
Import @sixtyfold/stock·interface
interface VolumeColorsVolumeProfileOptions
Estimated visible-range volume-by-price histogram configuration. The renderer distributes each OHLCV candle's volume uniformly across its reported low-to-high range. This is a candle-derived approximation, not exact trades-at-price or order-flow data.
Import @sixtyfold/stock·interface
interface VolumeProfileOptionsVWAPIndicatorConfig
VWAP indicator options.
Import @sixtyfold/stock·interface
interface VWAPIndicatorConfig extends VWAPCalculationOptions, StockIndicatorStyle| Member | Definition | Description |
|---|---|---|
color? | string | undefined | VWAP indicator color. |
id? | string | undefined | Unique identifier for this VWAP indicator. |
include | boolean | undefined | Whether this layer affects automatic Y-axis scaling. |
label? | string | undefined | VWAP indicator label. |
line | StockIndicatorLineDash | undefined | Canvas dash pattern in CSS pixels. |
line | number | undefined | Line width in CSS pixels. |
reset? | VWAPReset | undefined | UTC-aligned accumulation window. Defaults to day. |
reset | number | undefined | Moves the UTC reset boundary by this many milliseconds. Defaults to 0. |
source? | StockPriceSource | undefined | Defaults to the typical price, hlc3. |
type | "vwap" | Selects the type. |
visible? | boolean | undefined | Whether to render the VWAP indicator. |