• Finds signals representing significant changes or anomalies in a numeric time series.

    The function uses Z-Score based peak detection to identify periods where values deviate significantly from the moving average, indicating potential market turning points or trend changes.

    Parameters

    • values: number[]

      Array of numerical values to analyse (typically closing prices)

    • zScoreConfig: IZScoreConfig

      Z-Score algorithm parameters containing:

      • lag: Number of previous observations to use for calculating moving average
      • threshold: Z-Score threshold for signal detection
      • influence: Weight of new signals on the algorithm (0-1)

    Returns IPeak[]

    An array of detected peaks with their positions and directions:

    • position: Index in the original array where the signal was detected
    • direction: 1 for bullish (upward) signals, -1 for bearish (downward) signals

    Example

    const peaks = findSignals(
    [101, 102, 99, 101, 102, 107, 109, 105, 102, 100, 97, 95, 97],
    { lag: 5, threshold: 2.5, influence: 0.5 }
    );

Generated using TypeDoc