• Calculates pivot points from a single ICandle or an array of ICandles. If an array is passed, the function calculates high, low, and close values from all candles to compute the pivot points.

    Parameters

    • candles: ICandle | ICandle[]

      A single candle or an array of candles.

    • pricePrecision: number

      The price precision of the asset.

    Returns IPivotPoints

    The calculated pivot points.

    Example

    // Assuming 'dailyCandles' is an array of ICandle objects from a single day
    const pivotPoints: IPivotPoints = calculatePivotPoints(dailyCandles, 2);

    // Assuming 'yesterdayCandle' is a single ICandle object representing yesterday's day candle
    const pivotPoints: IPivotPoints = calculatePivotPoints(yesterdayCandle, 2);

Generated using TypeDoc