PersistRecentInstance

Implements IPersistRecentInstance

Default file-based implementation of IPersistRecentInstance.

Features:

  • Wraps PersistBase for atomic JSON writes
  • Uses symbol as entity ID within a per-context PersistBase
  • Context key includes backtest/live mode and optional frameName
constructor(symbol: string, strategyName: string, exchangeName: string, frameName: string, backtest: boolean);
symbol: string
strategyName: string
exchangeName: string
frameName: string
backtest: boolean
_storage: any

Underlying file-based storage scoped to this context

waitForInit(initial: boolean): Promise<void>;

Initializes the underlying PersistBase storage.

readRecentData(): Promise<IPublicSignalRow | null>;

Reads the persisted recent signal using symbol as the entity key.

writeRecentData(signalRow: IPublicSignalRow, _when: Date): Promise<void>;

Writes the recent signal using symbol as the entity key.