Interface IPersistRecentInstance

Per-context recent signal persistence instance interface. Scoped to a specific (symbol, strategyName, exchangeName, frameName, backtest) tuple.

Stores the latest active signal for the given context, allowing live/backtest separation. Custom adapters should implement this interface to override the default file-based recent signal behavior.

interface IPersistRecentInstance {
    readRecentData(): Promise<IPublicSignalRow>;
    waitForInit(initial: boolean): Promise<void>;
    writeRecentData(signalRow: IPublicSignalRow, when: Date): Promise<void>;
}

Implemented by

Methods

  • Initialize storage for this recent signal context.

    Parameters

    • initial: boolean

      Whether this is the first initialization

    Returns Promise<void>

    Promise that resolves when initialization is complete

  • Write the latest recent signal for this context.

    Parameters

    • signalRow: IPublicSignalRow

      Recent signal data to persist (already carries signalRow.timestamp)

    • when: Date

      Logical timestamp this signal belongs to (duplicates signalRow.timestamp for API consistency)

    Returns Promise<void>

    Promise that resolves when write is complete