Function getPositionHighestPnlCost

  • Returns the PnL cost (in quote currency) 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 cost or null

    import { getPositionHighestPnlCost } from "backtest-kit";

    const pnlCost = await getPositionHighestPnlCost("BTCUSDT");
    // e.g. 35.5