Function getPositionDrawdownMinutes

  • Returns the number of minutes elapsed since the highest profit price was recorded.

    Measures how long the position has been pulling back from its peak profit level. Zero when called at the exact moment the peak was set. Grows continuously as price moves away from the peak without setting a new record.

    Returns null if no pending signal exists.

    Parameters

    • symbol: string

      Trading pair symbol

    Returns Promise<number>

    Promise resolving to drawdown duration in minutes or null

    import { getPositionDrawdownMinutes } from "backtest-kit";

    const drawdown = await getPositionDrawdownMinutes("BTCUSDT");
    // e.g. 30 (30 minutes since the highest profit price)