Function getPositionMaxDrawdownMinutes

  • Returns the number of minutes elapsed since the worst loss price was recorded.

    Measures how long ago the deepest drawdown point occurred. Zero when called at the exact moment the trough was set.

    Returns null if no pending signal exists.

    Parameters

    • symbol: string

      Trading pair symbol

    Returns Promise<number>

    Promise resolving to minutes since last drawdown trough or null

    import { getPositionMaxDrawdownMinutes } from "backtest-kit";

    const minutes = await getPositionMaxDrawdownMinutes("BTCUSDT");
    // e.g. 15 (15 minutes since the worst loss price)