Function getPositionHighestPnlPercentage

  • Returns the PnL percentage at the moment the best profit price was recorded during this position's life.

    Returns null if no pending signal exists.

    Parameters

    • symbol: string

      Trading pair symbol

    Returns Promise<number>

    Promise resolving to PnL percentage or null

    import { getPositionHighestPnlPercentage } from "backtest-kit";

    const pnl = await getPositionHighestPnlPercentage("BTCUSDT");
    // e.g. 3.5