Function getPositionCountdownMinutes

  • Returns the remaining time before the position expires, clamped to zero.

    Computes elapsed minutes since pendingAt and subtracts from minuteEstimatedTime. Returns 0 once the estimate is exceeded (never negative).

    Returns null if no pending signal exists.

    Parameters

    • symbol: string

      Trading pair symbol

    Returns Promise<number>

    Promise resolving to remaining minutes (≥ 0) or null

    import { getPositionCountdownMinutes } from "backtest-kit";

    const remaining = await getPositionCountdownMinutes("BTCUSDT");
    // e.g. 45 (45 minutes left)
    // 0 when expired