• Creates an array of ZigZag points based on the provided candlestick data and configuration.

    ZigZag points represent significant market turning points by connecting price extremes, filtering out minor price movements. This implementation uses Z-Score algorithm to identify potential turning points in the price series.

    Parameters

    • candles: ICandle[]

      An array of candlestick data to analyse

    • config: ZigZagConfig

      Configuration for zigzag calculation:

      • lag: Controls smoothing and adaptability (from Z-Score)
      • threshold: Number of standard deviations required (from Z-Score)
      • influence: How strongly signals affect calculations (from Z-Score)
      • priceMethod: Method to determine zigzag price points ('close' or 'extremes')

    Returns IZigZag[]

    An array of ZigZag points with their direction, price, and timestamp

    Example

    const zigzags = create(candles, {
    lag: 5,
    threshold: 2.5,
    influence: 0.5,
    priceMethod: 'extremes'
    });

Generated using TypeDoc