interface BarCacheOptions {
    barCloses?: (interval: string, barStartSec: number) => null | number;
    max?: number;
    maxBars?: number;
    now?: () => number;
    storage?: BarCacheStore;
    timezone?: string;
    ttlMs?: number;
}

Properties

barCloses?: (interval: string, barStartSec: number) => null | number

Override how the cache decides when a bar closes. Return null for "unknown", which makes the cache refuse to store the series rather than guess. Defaults to barCloseSec, which asks the interval registry.

max?: number

Maximum entries before LRU eviction. Default 24.

maxBars?: number

Maximum total cached bars before LRU eviction. Default 250_000.

now?: () => number

Injectable clock (ms), for tests and for hosts with a server clock.

storage?: BarCacheStore

Optional durable store. Bounded in-memory retention is always enabled.

timezone?: string

IANA zone for calendar intervals. Defaults to the engine default.

ttlMs?: number

Absolute age bound, ms. Default 5 minutes.