Implements IPersistCandleInstance
Default file-based implementation of IPersistCandleInstance.
Features:
constructor(symbol: string, interval: CandleInterval, exchangeName: string);
symbol: string
interval: CandleInterval
exchangeName: string
_storage: any
Underlying file-based storage scoped to this context
waitForInit(initial: boolean): Promise<void>;
Initializes the underlying PersistBase storage.
readCandlesData(limit: number, sinceTimestamp: number, _untilTimestamp: number): Promise<CandleData[] | null>;
Reads cached candles for the requested window. Computes expected timestamps (sinceTimestamp + i * stepMs) and reads each by timestamp key. Returns null on ANY missing timestamp (cache miss). Invalid cached candles emit a warning via errorEmitter and are treated as miss.
writeCandlesData(candles: CandleData[]): Promise<void>;
Writes candles to cache. Skips incomplete candles (closeTime > now) and existing keys to keep the cache append-only for fully closed candles.