• 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

    • zScoreConfig: IZScoreConfig

      Z-Score algorithm parameters containing:

      • lag: Controls smoothing and adaptability
      • threshold: Number of standard deviations required for signal detection
      • influence: How strongly signals affect calculations (0-1)
    • priceMethod: "close" | "extremes" = 'close'

      Method to determine zigzag price points:

      • 'close': Uses closing prices for zigzag points
      • 'extremes': Uses high/low prices for zigzag points (default: 'close')

    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 },
    'extremes'
    );

Generated using TypeDoc