Function getPositionHighestProfitPrice

  • Returns the best price reached in the profit direction during this position's life.

    Initialized at position open with the entry price and timestamp. Updated on every tick/candle when VWAP moves beyond the previous record toward TP:

    • LONG: tracks the highest price seen above effective entry
    • SHORT: tracks the lowest price seen below effective entry

    Returns null if no pending signal exists. Never returns null when a signal is active — always contains at least the entry price.

    Parameters

    • symbol: string

      Trading pair symbol

    Returns Promise<number>

    Promise resolving to { price, timestamp } record or null

    import { getPositionHighestProfitPrice } from "backtest-kit";

    const peak = await getPositionHighestProfitPrice("BTCUSDT");
    // e.g. { price: 44500, timestamp: 1700000000000 }