Function getMaxDrawdownDistancePnlPercentage

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

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

    Parameters

    • symbol: string

      Trading pair symbol

    Returns Promise<number>

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

    import { getMaxDrawdownDistancePnlPercentage } from "backtest-kit";

    const dist = await getMaxDrawdownDistancePnlPercentage("BTCUSDT");
    // e.g. 3.5 (peak was +3.5% above trough)