Utility class for managing signal persistence.
Features:
Used by ClientStrategy for live mode persistence.
constructor();
PersistSignalInstanceCtor: any
Constructor used to create per-context signal instances. Replaceable via usePersistSignalAdapter() / useJson() / useDummy().
getStorage: any
Memoized factory creating one IPersistSignalInstance per (symbol, strategy, exchange) triple.
readSignalData: (symbol: string, strategyName: string, exchangeName: string) => Promise<ISignalRow>
Reads persisted signal for the given context. Lazily initializes the instance on first access.
writeSignalData: (signalRow: ISignalRow, symbol: string, strategyName: string, exchangeName: string) => Promise<void>
Writes signal data (or null to clear) for the given context. Lazily initializes the instance on first access.
usePersistSignalAdapter(Ctor: TPersistSignalInstanceCtor): void;
Registers a custom IPersistSignalInstance constructor. Clears the memoization cache so subsequent calls use the new adapter.
clear(): void;
Clears the memoized instance cache. Call when process.cwd() changes between strategy iterations.
useJson(): void;
Switches to the default file-based PersistSignalInstance.
useDummy(): void;
Switches to PersistSignalDummyInstance (all operations are no-ops).