Function getPositionInvestedCount

  • Returns the number of DCA entries made for the current pending signal.

    1 = original entry only (no DCA). Increases by 1 with each successful commitAverageBuy().

    Returns null if no pending signal exists.

    Automatically detects backtest/live mode from execution context.

    Parameters

    • symbol: string

      Trading pair symbol

    Returns Promise<number>

    Promise resolving to entry count or null

    import { getPositionInvestedCount } from "backtest-kit";

    const count = await getPositionInvestedCount("BTCUSDT");
    // No DCA: count === 1
    // After one DCA: count === 2