Function getCandles

  • Fetches historical candle data from the registered exchange.

    Candles are fetched backwards from the current execution context time. Uses the exchange's getCandles implementation.

    Parameters

    • symbol: string

      Trading pair symbol (e.g., "BTCUSDT")

    • interval: CandleInterval

      Candle interval ("1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h")

    • limit: number

      Number of candles to fetch

    Returns Promise<ICandleData[]>

    Promise resolving to array of candle data

    const candles = await getCandles("BTCUSDT", "1m", 100);
    console.log(candles[0]); // { timestamp, open, high, low, close, volume }