Function getMaxDrawdownDistancePnlCost

  • Returns the peak-to-trough PnL cost distance between the position's highest profit and deepest drawdown.

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

    Parameters

    • symbol: string

      Trading pair symbol

    Returns Promise<number>

    Promise resolving to peak-to-trough PnL cost distance (≥ 0) or null

    import { getMaxDrawdownDistancePnlCost } from "backtest-kit";

    const dist = await getMaxDrawdownDistancePnlCost("BTCUSDT");
    // e.g. 7.2 (peak was $7.2 above trough)