Function getPositionHighestMaxDrawdownPnlCost

  • Returns the distance in PnL cost between the current price and the worst drawdown trough.

    Computed as: max(0, currentPnlCost - fallPnlCost). Returns null if no pending signal exists.

    Parameters

    • symbol: string

      Trading pair symbol

    Returns Promise<number>

    Promise resolving to recovery distance in PnL cost (≥ 0) or null

    import { getPositionHighestMaxDrawdownPnlCost } from "backtest-kit";

    const dist = await getPositionHighestMaxDrawdownPnlCost("BTCUSDT");
    // e.g. 4.8 (recovered $4.8 from trough)