ti-engine
    Preparing search index...

    Interface CorrelationIndicatorsBulk

    Rolling correlation indicators.

    Windowing:

    • Output length = L - period + 1, where L is the input length.
    • pricesAssetA and pricesAssetB must have equal length.
    interface CorrelationIndicatorsBulk {
        correlateAssetPrices(
            pricesAssetA: number[],
            pricesAssetB: number[],
            constantModelType: ConstantModelType,
            deviationModel: DeviationModel,
            period: number,
        ): number[];
    }
    Index

    Methods

    • Rolling correlation between two price series.

      Parameters

      • pricesAssetA: number[]

        First asset prices.

      • pricesAssetB: number[]

        Second asset prices.

      • constantModelType: ConstantModelType

        Central model for demeaning (SMA, EMA, etc.).

      • deviationModel: DeviationModel

        Deviation model for scaling (StdDev, MAD, etc.).

      • period: number

        Rolling window length.

      Returns number[]

      Array of correlation values per window.

      const out = correlationIndicators.bulk.correlateAssetPrices(
      pricesA, pricesB, ConstantModelType.SimpleMovingAverage, DeviationModel.StandardDeviation, 20
      );