Creates new candle cache persistence instance.
Trading pair symbol
Candle interval (1m, 5m, 1h, etc.)
Exchange identifier
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.
Number of candles requested
Aligned start timestamp (openTime of first candle)
Reserved for API compatibility, unused
Promise resolving to candles in order, or null on cache miss
Initializes the underlying PersistBase storage.
Whether this is the first initialization
Promise that resolves when initialization is complete
Writes candles to cache. Skips incomplete candles (closeTime > now) and existing keys to keep the cache append-only for fully closed candles.
Array of candle data to cache
Promise that resolves when all writes are complete
Default file-based implementation of IPersistCandleInstance.
Features:
Example