Function getPositionHighestMaxDrawdownPnlPercentage

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

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

    Parameters

    • symbol: string

      Trading pair symbol

    Returns Promise<number>

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

    import { getPositionHighestMaxDrawdownPnlPercentage } from "backtest-kit";

    const dist = await getPositionHighestMaxDrawdownPnlPercentage("BTCUSDT");
    // e.g. 2.1 (recovered 2.1% from trough)