Skip to content

Implement Z-Score Indicator #364

@cinar

Description

@cinar

Description

Measures how many standard deviations price is away from its SMA.

Math/Formula

$$\text{Z-Score} = \frac{P_t - \text{SMA}(Price, n)}{\text{StdDev}(Price, n)}$$

Implementation Details

  • Struct name: ZScore[T helper.Number]
  • Constructor: NewZScore[T helper.Number](), NewZScoreWithPeriod[T helper.Number](period int)
  • Parameters: period (default: 20)
  • Functions: Compute(<-chan T) <-chan T, IdlePeriod() int, String() string
  • Use the existing Sma and MovingStd implementations.
  • Test files with 100% coverage.

Suggested Package

trend

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions