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
Description
Measures how many standard deviations price is away from its SMA.
Math/Formula
Implementation Details
ZScore[T helper.Number]NewZScore[T helper.Number](),NewZScoreWithPeriod[T helper.Number](period int)period(default: 20)Compute(<-chan T) <-chan T,IdlePeriod() int,String() stringSmaandMovingStdimplementations.Suggested Package
trend