Function getPositionEntries

  • Returns the list of DCA entry prices and costs for the current pending signal.

    Each element represents a single position entry — the initial open or a subsequent DCA entry added via commitAverageBuy.

    Returns null if no pending signal exists. Returns a single-element array if no DCA entries were made.

    Each entry contains:

    • price — execution price of this entry
    • cost — dollar cost allocated to this entry (e.g. 100 for $100)

    Parameters

    • symbol: string

      Trading pair symbol

    Returns Promise<{ cost: number; price: number; timestamp: number }[]>

    Promise resolving to array of entry records or null

    import { getPositionEntries } from "backtest-kit";

    const entries = await getPositionEntries("BTCUSDT");
    // No DCA: [{ price: 43000, cost: 100 }]
    // One DCA: [{ price: 43000, cost: 100 }, { price: 42000, cost: 100 }]