Function readMemory

  • Reads a value from memory scoped to the current signal.

    Resolves the active pending or scheduled signal automatically from execution context. Automatically detects backtest/live mode from execution context.

    Type Parameters

    • T extends object = object

    Parameters

    • dto: { bucketName: string; memoryId: string }
      • bucketName: string

        Memory bucket name

      • memoryId: string

        Unique memory entry identifier

    Returns Promise<T>

    Promise resolving to stored value

    Error if no pending or scheduled signal exists, or if entry not found

    import { readMemory } from "backtest-kit";

    const ctx = await readMemory<{ trend: string }>({ bucketName: "my-strategy", memoryId: "context" });