PersistStrategyInstance

Implements IPersistStrategyInstance

Default file-based implementation of IPersistStrategyInstance.

Features:

  • Wraps PersistBase for atomic JSON writes
  • Uses fixed entity ID "strategy" within a per-context PersistBase
  • Crash-safe via atomic writes
constructor(symbol: string, strategyName: string, exchangeName: string);
symbol: string
strategyName: string
exchangeName: string
STORAGE_KEY: any

Fixed entity key for storing the strategy state snapshot

_storage: any

Underlying file-based storage scoped to this context

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

Initializes the underlying PersistBase storage.

readStrategyData(): Promise<StrategyData | null>;

Reads the persisted strategy state snapshot using the fixed STORAGE_KEY.

writeStrategyData(row: StrategyData | null): Promise<void>;

Writes the strategy state snapshot (or null to clear) using the fixed STORAGE_KEY.