Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExponentialMovingAverage ¶
type ExponentialMovingAverage struct {
// contains filtered or unexported fields
}
Exponential computes the moving average of a value
func New ¶
func New(period time.Duration) *ExponentialMovingAverage
NewExponentialMovingAverage creates an EMA for a given period
func (*ExponentialMovingAverage) Update ¶
func (ema *ExponentialMovingAverage) Update(value float64) float64
Update computes the next value in a moving average
func (*ExponentialMovingAverage) Value ¶
func (ema *ExponentialMovingAverage) Value() float64
Value gets the current average
Click to show internal directories.
Click to hide internal directories.