/ fm / liveswitch / MovingAverage
Class: MovingAverage
fm.liveswitch.MovingAverage
A moving average.
Table of contents
Constructors
Methods
Constructors
constructor
+ new MovingAverage(lookback
: number): MovingAverage
Initializes a new instance of the [[fm.liveswitch.movingAverage]] class.
Parameters:
Name | Type | Description |
---|---|---|
lookback |
number | The number of lookback values. |
Returns: MovingAverage
Defined in: Generated/TypeScript/fm.liveswitch/MovingAverage.ts:32
Methods
add
▸ add(value
: number): void
Adds a sample.
Parameters:
Name | Type | Description |
---|---|---|
value |
number | The value to add. |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/MovingAverage.ts:67
fmliveswitchMovingAverageInit
▸ Private
fmliveswitchMovingAverageInit(): void
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/MovingAverage.ts:25
getAverage
▸ getAverage(): number
Gets the average.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/MovingAverage.ts:87
getTypeString
▸ getTypeString(): string
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/MovingAverage.ts:9