Data feeds
API reference for extended data provider interfaces covering footprint slices, market depth, trades, quotes, and tick charts.
This page documents the extended feed interfaces that a DataProvider can implement beyond OHLCV candles, including footprint slices, Level 2 market depth, trade tape streams, quotes, tick feeds and anchoring helpers, and the in-memory footprint store.
Import symbols on this page from @luxalgo/vela-pro. Related guides: Data connectivity overview, Footprint data, Quotes and market depth, Tick charts.
Feature enabler for this area (enableTickCharts) is documented on Enablers and options.
Functions
aggregateTicks
One-shot tick aggregation returning both the historical bars and the warm live builder.
function aggregateTicks(
ticks: readonly TickPrint[],
ticksPerBar: number,
anchor: TickAnchor,
opts?: TickAggregateOptions,
): { bars: OHLCV[]; builder: TickBarBuilder }See also: TickAggregateOptions, TickAnchor, TickBarBuilder, TickPrint. From @luxalgo/vela/plugin: OHLCV.
anchorKey
Stable string key for an anchor (used for builder/session identity comparisons).
function anchorKey(anchor: TickAnchor): stringSee also: TickAnchor.
anchorsEqual
Value equality between two tick anchors.
function anchorsEqual(a: TickAnchor, b: TickAnchor): booleanSee also: TickAnchor.
anchorShortLabel
Compact label for the topbar anchor button ("Session", "09:30", "Rolling", "Custom").
function anchorShortLabel(anchor: TickAnchor): stringSee also: TickAnchor.
bindTickStyleSwitch
Bind automatic 1T → line style switching and restore onto one chart instance. Returns a disposer that removes all listeners.
function bindTickStyleSwitch(chart: TickStyleChart): () => voidSee also: TickStyleChart.
blankQuote
Also exported from @luxalgo/vela-pro-watchlist, @luxalgo/vela-pro/plugin.
function blankQuote(symbol: string): QuoteSee also: Quote.
boundaryResolverFor
Build the boundary resolver function for any TickAnchor and market context.
function boundaryResolverFor(
anchor: TickAnchor,
opts?: { symbolInfo?: SymbolInfo; session?: string; calendarWindows?: ReadonlyArray<readonly [number, number]> },
): (timeMs: number) => numberSee also: TickAnchor. From @luxalgo/vela/plugin: SymbolInfo.
createTickSeriesAdapter
Create the tick SeriesAdapter backed by opts.store.
function createTickSeriesAdapter(opts: TickAdapterOptions): SeriesAdapterSee also: TickAdapterOptions. From @luxalgo/vela/plugin: SeriesAdapter.
defaultTickMarketKey
Default symbol → market key: trimmed uppercase ('binance:BTCUSDT' → 'BINANCE:BTCUSDT').
function defaultTickMarketKey(symbol: string): stringdescribeMarketSession
Human-readable description of the market's session open (shown in the anchor dialog).
function describeMarketSession(info: SymbolInfo | undefined, session?: string): stringFrom @luxalgo/vela/plugin: SymbolInfo.
fetchPublicTicks
Fetch ascending historical TickPrints for a public crypto venue. Walks backward in bounded pages until targetTicks have landed (or maxRequests is reached).
function fetchPublicTicks(
providerName: string,
ticker: string,
targetTicks: number,
maxRequests?: number,
): Promise<TickPrint[]>Default: maxRequests = DEFAULT_MAX_HISTORY_REQUESTS.
See also: TickPrint.
footprintFeedFor
The shared order-flow feed behind a chart symbol, or null when its provider serves none. The entry point for any indicator that reads footprints: everything read through it is fetched once and shared with every other consumer of that provider.
function footprintFeedFor(
data: FootprintFeedSurface,
symbol: string,
): { feed: FootprintStore; ticker: string; provider: string } | nullSee also: FootprintFeedSurface, FootprintStore.
footprintStore
The shared store of a footprint-capable provider: one per provider instance.
function footprintStore(feed: FootprintFeed): FootprintStoreSee also: FootprintFeed, FootprintStore.
formatTimeOfDay
Format { hour, minute } as zero-padded HH:MM.
function formatTimeOfDay(hour: number, minute: number): stringgetTickAnchor
Read the active tick anchor for symbol (returns the default anchor when no override is set).
function getTickAnchor(symbol: string): TickAnchorSee also: TickAnchor.
groupLevels
Group book levels into step-wide buckets (bids floor, asks ceil), summing their sizes.
Also exported from @luxalgo/vela-pro/plugin.
function groupLevels(levels: readonly BookLevel[], step: number, side: 'bid' | 'ask'): BookLevel[]See also: BookLevel.
hasDepthFeed
Also exported from @luxalgo/vela-pro/plugin.
function hasDepthFeed(p: unknown): p is DepthFeedSee also: DepthFeed.
hasFootprints
Narrow a registered provider to its order-flow surface, if it has one.
function hasFootprints(p: DataProvider | undefined): p is DataProvider & FootprintFeedSee also: FootprintFeed. From @luxalgo/vela/plugin: DataProvider.
hasPublicTickFeed
Whether this registered provider name has a built-in public trade feed.
function hasPublicTickFeed(providerName: string): booleanhasTickBarFeed
Narrow a registered provider to TickBarFeed.
function hasTickBarFeed(p: DataProvider | undefined): p is DataProvider & TickBarFeedSee also: TickBarFeed. From @luxalgo/vela/plugin: DataProvider.
hasTickFeed
Narrow a registered provider to TickFeed.
function hasTickFeed(p: DataProvider | undefined): p is DataProvider & TickFeedSee also: TickFeed. From @luxalgo/vela/plugin: DataProvider.
normalizeAnchor
Validate and normalize an untrusted anchor payload (persisted storage / documents).
function normalizeAnchor(raw: unknown): TickAnchor | nullSee also: TickAnchor.
onTickAnchorChange
Listen for per-market tick anchor changes. Returns an unsubscribe function.
function onTickAnchorChange(cb: (marketKey: string, anchor: TickAnchor) => void): () => voidSee also: TickAnchor.
parseSessionOpen
Extract the opening { hour, minute } from a Pine/Vela session string ('0930-1600', '1700-1600').
function parseSessionOpen(sessionStr: string): { hour: number; minute: number } | nullparseTimeOfDay
Parse HH:MM (or HHMM) into 24-hour { hour, minute }, or null when invalid.
function parseTimeOfDay(raw: string): { hour: number; minute: number } | nullresetTickAnchor
Reset symbol back to the default tick anchor.
function resetTickAnchor(symbol: string): voidrestoreTickReplacedStyle
Put back the memory of the style 1T replaced on chart (a saved state being applied). Ignored unless the chart is on 1T, drawn as a line, and style is one 1T replaces.
function restoreTickReplacedStyle(chart: TickStyleChart, style: unknown): voidSee also: TickStyleChart.
sessionBoundaryResolver
Returns a boundary resolver anchored to the asset's trading session opens. Prefers provider-resolved calendarWindows (holidays + DST applied server-side), falling back to SymbolInfo.session / session_extended + timezone, and UTC 00:00 for 24×7 markets.
function sessionBoundaryResolver(
symbolInfo: SymbolInfo | undefined,
session?: string,
calendarWindows?: ReadonlyArray<readonly [number, number]>,
): (timeMs: number) => numberFrom @luxalgo/vela/plugin: SymbolInfo.
setTickAnchor
Set the tick anchor for symbol. Any open tick chart on that market reloads automatically.
function setTickAnchor(symbol: string, anchor: TickAnchor): voidSee also: TickAnchor.
subscribePublicTicks
Subscribe to live TickPrints from the venue's public trade stream.
function subscribePublicTicks(
providerName: string,
ticker: string,
onTicks: (ticks: readonly TickPrint[]) => void,
): () => voidSee also: TickPrint.
tickReplacedStyle
The style 1T replaced on chart, or undefined when it replaced none.
function tickReplacedStyle(chart: object): string | undefinedtimeOfDayBoundaryResolver
Returns a fast function mapping any epoch-ms timestamp to the epoch ms of the most recent daily occurrence of hhmm in timezone at or before timeMs. Caches resolved civil days so thousands of ticks inside a day pay an O(1) comparison.
function timeOfDayBoundaryResolver(hhmm: string, timezone?: string): (timeMs: number) => numberDefault: timezone = 'Etc/UTC'.
withChange
Chg and Chg% from the last price and the previous close.
Also exported from @luxalgo/vela-pro-watchlist, @luxalgo/vela-pro/plugin.
function withChange(q: Quote): QuoteSee also: Quote.
withTickFeed
Attach a TickFeed onto any existing DataProvider instance while preserving all of its methods, prototype, and extended surfaces (such as FootprintFeed / DepthFeed).
const provider = withTickFeed(myProvider, {
getTicks: (ticker, range) => myApi.fetchTrades(ticker, range),
subscribeTicks: (ticker, onTicks) => myApi.streamTrades(ticker, onTicks),
});function withTickFeed<P extends DataProvider>(provider: P, feed: TickFeed): P & TickFeedSee also: TickFeed. From @luxalgo/vela/plugin: DataProvider.
Classes
BookState
One book kept from a snapshot and its level changes (a size of 0 removes a level): the shape most venues send.
class BookState {
tick: number;
time: number;
reset(
bids: ReadonlyArray<readonly [number, number]>,
asks: ReadonlyArray<readonly [number, number]>,
tick: number,
time?: number,
): void;
update(
bids: ReadonlyArray<readonly [number, number]>,
asks: ReadonlyArray<readonly [number, number]>,
time?: number,
): void;
snapshot(depth?: number): BookSnapshot;
}Defaults: reset(time = Date.now()), update(time = Date.now()), snapshot(depth = 50).
See also: BookSnapshot.
FootprintStore class
class FootprintStore implements FootprintFeed {
constructor(source: FootprintFeed);
footprintCaps(ticker: string): FootprintCaps;
getFootprints(ticker: string, range: FootprintRange, sliceMs?: number): Promise<FootprintBatch>;
subscribeFootprints(
ticker: string,
since: number,
onSlices: (slices: FootprintSlice[]) => void,
): () => void;
peek(
ticker: string,
range: { from: number; to: number; session?: string },
sliceMs?: number,
): FootprintPeek;
stats(): FootprintStoreStats;
clear(): void;
}| Member | Type | Description |
|---|---|---|
constructor | (source: FootprintFeed) | |
footprintCaps() | (ticker: string) => FootprintCaps | Fetch-planner capabilities for one ticker. |
getFootprints() | (ticker: string, range: FootprintRange, sliceMs?: number) => Promise<FootprintBatch> | Pre-aggregated one-minute footprint slices for [range.from, range.to]. sliceMs is a granularity HINT (the chart's bar duration): a multi-timeframe source may serve bucket slices that divide it (fewer, bigger slices, same sums). Returns a completeness-aware batch (see FootprintBatch). |
subscribeFootprints() | (ticker: string, since: number, onSlices: (slices: FootprintSlice[]) => void) => () => void | Live footprint slices from since onward. Deliveries are FULL-STATE snapshots per slice (the forming minute grows across deliveries): consumers replace by slice time, never accumulate. Returns an unsubscribe function. |
peek() | (ticker: string, range: { from: number; to: number; session?: string }, sliceMs?: number) => FootprintPeek | What the store holds for (ticker, session, sliceMs) inside [from, to]: no request. |
stats() | () => FootprintStoreStats | |
clear() | () => void | Forget every kept interval (live subscriptions are untouched). |
See also: FootprintBatch, FootprintCaps, FootprintFeed, FootprintPeek, FootprintRange, FootprintSlice, FootprintStoreStats.
LocalTickAnchorStorage
class LocalTickAnchorStorage implements TickAnchorStorage {
constructor(key?: string);
load(): Record<string, TickAnchor>;
save(anchors: Readonly<Record<string, TickAnchor>>): void;
}Default: constructor(key = DEFAULT_TICK_ANCHORS_STORAGE_KEY).
See also: TickAnchor, TickAnchorStorage.
ProviderQuotes
Also exported from @luxalgo/vela-pro-watchlist, @luxalgo/vela-pro/plugin.
class ProviderQuotes implements QuoteSource {
constructor(data: () => DataFacade | null);
dailyBars(symbol: string, count: number): Promise<OHLCV[]>;
watch(symbol: string, onQuote: (q: Quote) => void): () => void;
peek(symbol: string): Quote | null;
dispose(): void;
}
// Unexported supporting type referenced above
type DataFacade = WidgetContext['chart']['data'];| Member | Type | Description |
|---|---|---|
constructor | (data: () => DataFacade | null) | data: the registry to resolve symbols through (the active chart's). |
dailyBars() | (symbol: string, count: number) => Promise<OHLCV[]> | Up to count daily bars of symbol, oldest first; the last may be today's, still forming. Rejects when no history can be had. Optional: without it, the figures read from daily history (period returns, drawdowns, correlations) stay empty. |
watch() | (symbol: string, onQuote: (q: Quote) => void) => () => void | Follow symbol's quote; onQuote gets every change. Returns the unsubscribe. |
peek() | (symbol: string) => Quote | null | The latest quote held for symbol (null when nobody watches it). |
dispose() | () => void |
See also: Quote, QuoteSource. From @luxalgo/vela/plugin: OHLCV, WidgetContext.
TickAnchorStore
class TickAnchorStore {
configure(opts: { defaultAnchor?: TickAnchor; anchors?: Readonly<Record<string, TickAnchor>>; marketKey?: (symbol: string) => string; storage?: TickAnchorStorage | false }): void;
keyOf(symbol: string): string;
getDefault(): TickAnchor;
get(symbol: string): TickAnchor;
hasOverride(symbol: string): boolean;
set(symbol: string, anchor: TickAnchor): void;
reset(symbol: string): void;
snapshot(): Record<string, TickAnchor>;
restore(raw: unknown): void;
subscribe(listener: AnchorListener): () => void;
clear(): void;
}
// Unexported supporting type referenced above
type AnchorListener = (marketKey: string, anchor: TickAnchor) => void;| Member | Type | Description |
|---|---|---|
configure() | (opts: { defaultAnchor?: TickAnchor; anchors?: Readonly<Record<string, … (truncated; see declaration) | |
keyOf() | (symbol: string) => string | |
getDefault() | () => TickAnchor | |
get() | (symbol: string) => TickAnchor | Effective anchor for symbol: explicit per-market override, else the configured default. |
hasOverride() | (symbol: string) => boolean | Whether symbol has an explicit per-market override. |
set() | (symbol: string, anchor: TickAnchor) => void | Set (or clear back to default) the anchor for symbol. Notifies listeners on change. |
reset() | (symbol: string) => void | Remove symbol's custom override, restoring the default anchor. |
snapshot() | () => Record<string, TickAnchor> | Snapshot of all explicit per-market overrides (for state persistence). |
restore() | (raw: unknown) => void | Restore persisted overrides from a workspace state document. |
subscribe() | (listener: AnchorListener) => () => void | |
clear() | () => void | Clear overrides (for tests). |
See also: TickAnchor, TickAnchorStorage.
TickBarBuilder
Stateful nT tick-bar builder. Seed from historical ticks via seed, then stream live trades via push / pushBatch to receive forming-bar refinements and freshly opened bars with monotonic seq.
class TickBarBuilder {
constructor(ticksPerBar: number, anchor: TickAnchor, opts?: TickAggregateOptions);
readonly ticksPerBar: number;
readonly anchor: TickAnchor;
readonly currentTickCount: number;
clone(): TickBarBuilder;
seed(ticks: readonly TickPrint[]): OHLCV[];
push(tick: TickPrint): OHLCV | null;
pushBatch(ticks: readonly TickPrint[]): OHLCV[];
}| Member | Type | Description |
|---|---|---|
constructor | (ticksPerBar: number, anchor: TickAnchor, opts?: TickAggregateOptions) | |
ticksPerBar | number | |
anchor | TickAnchor | |
currentTickCount | number | Ticks accumulated in the current forming bar (0 before the first tick). |
clone() | () => TickBarBuilder | An independent builder in this one's exact state. Each live consumer of a series continues from its own copy, so two charts on one series never share a tick count or a set of seen trade ids. |
seed() | (ticks: readonly TickPrint[]) => OHLCV[] | Seed the builder from historical ticks (sorted ascending) and return all built bars. |
push() | (tick: TickPrint) => OHLCV | null | Ingest one live tick and return the updated/newly-opened bar snapshot (or null if the tick was a duplicate id or out-of-order behind the latest bar). |
pushBatch() | (ticks: readonly TickPrint[]) => OHLCV[] | Ingest a batch of live ticks (e.g. one WebSocket frame). Emits every distinct bar transition in order, coalescing multiple refinements of the same forming bar so the chart only paints the latest state of each bar touched by the frame. |
See also: TickAggregateOptions, TickAnchor, TickPrint. From @luxalgo/vela/plugin: OHLCV.
TickBarTimeline
class TickBarTimeline {
clone(): TickBarTimeline;
history(bars: readonly OHLCV[]): OHLCV[];
live(bar: OHLCV): OHLCV | null;
}| Member | Type | Description |
|---|---|---|
clone() | () => TickBarTimeline | An independent timeline in this one's state: each live consumer continues from its own. |
history() | (bars: readonly OHLCV[]) => OHLCV[] | A history answer. Every entry is a bar of its own, including entries that share a time; only an entry repeating the previous one's time AND seq replaces it. |
live() | (bar: OHLCV) => OHLCV | null | A live bar. One at the newest bar's time (and seq, when the source sends it) updates that bar; a later one opens the next. null for a bar older than the newest. |
From @luxalgo/vela/plugin: OHLCV.
Interfaces and types
BookLevel
Also exported from @luxalgo/vela-pro/plugin.
interface BookLevel {
price: number;
size: number;
}BookSnapshot
Also exported from @luxalgo/vela-pro/plugin.
interface BookSnapshot {
bids: BookLevel[];
asks: BookLevel[];
tick: number;
time: number;
}| Member | Type | Description |
|---|---|---|
bids | BookLevel[] | Best first: highest bid first, lowest ask first. |
asks | BookLevel[] | |
tick | number | The price increment the book is read at. |
time | number |
See also: BookLevel.
DepthFeed
interface DepthFeed {
subscribeBook?(
ticker: string,
onBook: (book: BookSnapshot) => void,
opts?: { depth?: number; onError?: (reason: string) => void },
): DepthSubscription;
subscribeTrades?(
ticker: string,
onTrades: (trades: TapeTrade[], history?: boolean) => void,
opts?: { onError?: (reason: string) => void },
): DepthSubscription;
}| Member | Type | Description |
|---|---|---|
subscribeBook?() | (ticker: string, onBook: (book: BookSnapshot) => void, opts?: { depth?: number; … (truncated; see declaration) | Follow ticker's book; onBook gets the whole (top-depth) book after every change. |
subscribeTrades?() | (ticker: string, onTrades: (trades: TapeTrade[], history?: boolean) => void, … (truncated; see declaration) | Follow ticker's trades; onTrades gets new prints, newest last (history marks a first backfill). |
See also: BookSnapshot, DepthSubscription, TapeTrade.
DepthSubscription
Also exported from @luxalgo/vela-pro/plugin.
interface DepthSubscription {
close(): void;
}FootprintCaps
How the engine's fetch planner should treat this feed for one ticker.
interface FootprintCaps {
bulkFetch: boolean;
maxFetchSpanSec?: number;
}| Member | Type | Description |
|---|---|---|
bulkFetch | boolean | One request returns complete slices for a wide range at low cost (a pre-aggregated, server-cached source). The planner then keeps the whole visible range covered instead of rationing tiny chunks. |
maxFetchSpanSec? | number | Cap on one viewport fetch window, in SECONDS (Infinity = uncapped: the visible range plus its pan buffer is the only bound). |
FootprintFeed
The order-flow surface a footprint-capable provider exposes (beyond the core's port).
interface FootprintFeed {
getFootprints(ticker: string, range: FootprintRange, sliceMs?: number): Promise<FootprintBatch>;
subscribeFootprints(
ticker: string,
since: number,
onSlices: (slices: FootprintSlice[]) => void,
): () => void;
footprintCaps(ticker: string): FootprintCaps;
}| Member | Type | Description |
|---|---|---|
getFootprints() | (ticker: string, range: FootprintRange, sliceMs?: number) => Promise<FootprintBatch> | Pre-aggregated one-minute footprint slices for [range.from, range.to]. sliceMs is a granularity HINT (the chart's bar duration): a multi-timeframe source may serve bucket slices that divide it (fewer, bigger slices, same sums). Returns a completeness-aware batch (see FootprintBatch). |
subscribeFootprints() | (ticker: string, since: number, onSlices: (slices: FootprintSlice[]) => void) => () => void | Live footprint slices from since onward. Deliveries are FULL-STATE snapshots per slice (the forming minute grows across deliveries): consumers replace by slice time, never accumulate. Returns an unsubscribe function. |
footprintCaps() | (ticker: string) => FootprintCaps | Fetch-planner capabilities for one ticker. |
See also: FootprintBatch, FootprintCaps, FootprintRange, FootprintSlice.
FootprintFeedSurface
What footprintFeedFor needs of a chart's data surface: structural, so any host context fits.
interface FootprintFeedSurface {
resolve(symbol: string): { provider: string; ticker: string } | null;
providerInstance(name: string): DataProvider | undefined;
}From @luxalgo/vela/plugin: DataProvider.
FootprintPeek
A synchronous look at what the store holds for one series.
interface FootprintPeek {
slices: FootprintSlice[];
covered: Array<[number, number]>;
}| Member | Type | Description |
|---|---|---|
slices | FootprintSlice[] | Kept slices inside the asked range, ascending. |
covered | Array<[number, number]> | The [from, to) stretches of the range the slices are authoritative for. |
See also: FootprintSlice.
FootprintRange
A time range request, [from, to] epoch ms (either side optional).
interface FootprintRange {
from?: number;
to?: number;
session?: string;
}| Member | Type | Description |
|---|---|---|
from? | number | |
to? | number | |
session? | string | The chart's trading session ('regular' | 'extended'): session markets store the extended superset and filter at serve time, so an RTH consumer must say so or the server's regular default decides. Ignored by continuous markets. |
FootprintStoreStats
What the store did since it was created (diagnostics and tests).
interface FootprintStoreStats {
upstreamRequests: number;
memoryHits: number;
sharedRequests: number;
liveUpstreams: number;
liveSubscribers: number;
intervals: number;
retainedLevels: number;
}| Member | Type | Description |
|---|---|---|
upstreamRequests | number | Range requests sent to the underlying feed. |
memoryHits | number | Answers served entirely from memory. |
sharedRequests | number | Requests that joined an identical one already in flight. |
liveUpstreams | number | Upstream live subscriptions currently open. |
liveSubscribers | number | Live subscribers currently fed. |
intervals | number | |
retainedLevels | number |
Quote
One symbol's quote.
Also exported from @luxalgo/vela-pro-watchlist, @luxalgo/vela-pro/plugin.
interface Quote {
symbol: string;
last: number | null;
prevClose: number | null;
open: number | null;
high: number | null;
low: number | null;
volume: number | null;
change: number | null;
changePercent: number | null;
spark: number[];
tick: number;
updated: number;
unresolved?: boolean;
}| Member | Type | Description |
|---|---|---|
symbol | string | |
last | number | null | |
prevClose | number | null | The previous session's close: what Chg and Chg% are measured from. |
open | number | null | |
high | number | null | |
low | number | null | |
volume | number | null | |
change | number | null | |
changePercent | number | null | |
spark | number[] | Closes over the last day, oldest first. |
tick | number | Price increment, for formatting. |
updated | number | |
unresolved? | boolean | No provider serves the symbol. |
QuoteSource
Also exported from @luxalgo/vela-pro-watchlist, @luxalgo/vela-pro/plugin.
interface QuoteSource {
watch(symbol: string, onQuote: (q: Quote) => void): () => void;
dailyBars?(symbol: string, count: number): Promise<readonly OHLCV[]>;
}| Member | Type | Description |
|---|---|---|
watch() | (symbol: string, onQuote: (q: Quote) => void) => () => void | Follow symbol's quote; onQuote gets every change. Returns the unsubscribe. |
dailyBars?() | (symbol: string, count: number) => Promise<readonly OHLCV[]> | Up to count daily bars of symbol, oldest first; the last may be today's, still forming. Rejects when no history can be had. Optional: without it, the figures read from daily history (period returns, drawdowns, correlations) stay empty. |
See also: Quote. From @luxalgo/vela/plugin: OHLCV.
TapeTrade
Also exported from @luxalgo/vela-pro/plugin.
interface TapeTrade {
id: string;
time: number;
price: number;
size: number;
side: 'buy' | 'sell';
}| Member | Type | Description |
|---|---|---|
id | string | |
time | number | |
price | number | |
size | number | |
side | 'buy' | 'sell' | The taker's side. |
TickAdapterOptions
interface TickAdapterOptions {
store: TickAnchorStore;
publicCryptoTrades?: boolean;
maxHistoryRequests?: number;
}See also: TickAnchorStore.
TickAggregateOptions
interface TickAggregateOptions {
symbolInfo?: SymbolInfo;
session?: string;
calendarWindows?: ReadonlyArray<readonly [number, number]>;
}From @luxalgo/vela/plugin: SymbolInfo.
TickAnchor
How tick counting resets to form nT bars for a given market:
'session': reset at each trading session open (fromSymbolInfo.session+timezoneandDataProvider.getCalendarwhen available; UTC 00:00 for 24×7 markets).'timeOfDay': reset daily at a user-chosenHH:MMwall-clock time intimezone(defaults to the market's ownSymbolInfo.timezone, else'Etc/UTC').'timestamp': anchor tick #0 at an exact epoch-ms instant (ticks before it group backward so a bar boundary lands right on the anchor; ticks at/after count forward).'rolling': continuous count from the first tick with no periodic resets.
type TickAnchor =
| { readonly mode: 'session' }
| { readonly mode: 'timeOfDay'; readonly time: string; readonly timezone?: string }
| { readonly mode: 'timestamp'; readonly time: number }
| { readonly mode: 'rolling' };TickAnchorStorage
Storage adapter for per-market tick anchor overrides.
interface TickAnchorStorage {
load(): Record<string, TickAnchor>;
save(anchors: Readonly<Record<string, TickAnchor>>): void;
}See also: TickAnchor.
TickBarFeed
Optional pre-aggregated tick-bar surface on a DataProvider, discovered via hasTickBarFeed. Use when your backend computes anchored nT bars server-side.
interface TickBarFeed {
getTickBars(
ticker: string,
ticksPerBar: number,
range: BarRange,
anchor: TickAnchor,
): Promise<OHLCV[]>;
subscribeTickBars?(
ticker: string,
ticksPerBar: number,
onBar: (bar: OHLCV) => void,
opts?: { session?: string; anchor?: TickAnchor },
): () => void;
supportsTicks?(ticker: string): boolean | Promise<boolean>;
}See also: TickAnchor. From @luxalgo/vela/plugin: BarRange, OHLCV.
TickFeed
Optional tick-print surface on a DataProvider, discovered via hasTickFeed. Implementing this lets Vela Pro build any nT timeframe with full per-market anchoring and live streaming from raw ticks.
interface TickFeed {
getTicks(ticker: string, range: TickRange): Promise<TickPrint[]>;
subscribeTicks?(ticker: string, onTicks: (ticks: readonly TickPrint[]) => void): () => void;
supportsTicks?(ticker: string): boolean | Promise<boolean>;
}See also: TickPrint, TickRange.
TickPrint
One individual trade / price print used to build nT tick bars.
interface TickPrint {
time: number;
price: number;
volume?: number;
id?: string;
}| Member | Type | Description |
|---|---|---|
time | number | Trade execution timestamp in Unix epoch milliseconds. |
price | number | Execution price. |
volume? | number | Trade size / volume (defaults to 0 when omitted). |
id? | string | Optional venue trade id for deduplicating REST/WebSocket overlap. |
TickRange
Query window for TickFeed.getTicks.
interface TickRange {
from?: number;
to?: number;
limit?: number;
session?: string;
}| Member | Type | Description |
|---|---|---|
from? | number | |
to? | number | |
limit? | number | Target maximum number of ticks to return (newest first or ending at to). |
session? | string |
TickStyleChart
Minimal chart surface needed by bindTickStyleSwitch (satisfied by Vela charts and unit fakes).
interface TickStyleChart {
readonly market: { readonly timeframe?: string };
readonly renderer: {
get(feature: string): unknown;
applyConfig(patch: unknown): void;
onConfigChanged(cb: () => void): () => void;
};
on(event: 'market:changed', cb: (e: { symbol: string; timeframe: string }) => void): () => void;
}Constants
DEFAULT_TICK_ANCHOR
Default anchor: start of each asset trading session.
const DEFAULT_TICK_ANCHOR: TickAnchor;See also: TickAnchor.
DEFAULT_TICK_ANCHORS_STORAGE_KEY
const DEFAULT_TICK_ANCHORS_STORAGE_KEY: 'vela-pro.tickAnchors';DEFAULT_TICK_PRESETS
const DEFAULT_TICK_PRESETS: readonly string[];SINGLE_TICK_REPLACED_STYLES
Styles whose OHLC body/wick representation is meaningless on single-tick (1T) bars.
const SINGLE_TICK_REPLACED_STYLES: ReadonlySet<string>;TICK_PERSISTENCE_KEY
const TICK_PERSISTENCE_KEY: 'vela-pro.tickAnchors';TICK_SERIES_ADAPTER_ID
const TICK_SERIES_ADAPTER_ID: 'vela-pro.ticks';TICK_STYLE_PERSISTENCE_KEY
const TICK_STYLE_PERSISTENCE_KEY: 'vela-pro.tickStyle';tickAnchorStore constant
Shared singleton anchor store used by enableTickCharts and runtime helpers.
const tickAnchorStore: TickAnchorStore;See also: TickAnchorStore.