movingaverage

package
v0.0.0-...-d2be49e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 3 Imported by: 0

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL