SimpleMovingAverage
The mean close of the last window candles of a pair (default 20).
- Indicator: lib's time-windowed
SimpleMovingAverage<DateTimeOffset, DecimalAmount>. A sample is the candle's close at itswindowEnd. - Window: the oldest sample expires once it is
window × intervalolder than the newest, which keeps exactlywindowconsecutive candles. The interval is taken from the first candle of a pair, so deploy one worker per interval. Monthly candles (1M) have no fixed length and are an error. - Value:
{ "value": 62041.40 }, rounded to 8 decimal places, from the first candle on (the mean of the candles seen so far).
| Property | Value |
|---|---|
| Project | Virtufin.Worker.SimpleMovingAverage |
| Base class | Virtufin.Indicator.DevKit.IndicatorWorkerBase |
| Engine | application/x-dotnet-dll |
| Input | candle events, e.g. act.exchange.binance.ohlcv.candle.1m.BTCUSDT |
| Output | sc.<scenarioid>.indicator.<indicatorname>.<PAIR>.changed |
| State | sc.<scenarioid>.indicator.<indicatorname>.<PAIR> |
Config (CreateWorker config)
| Key | Required | Meaning |
|---|---|---|
scenarioid |
yes | The scenario the indicator belongs to (topic and state key) |
indicatorname |
yes | Topic and state-key segment, e.g. sma20 |
window |
no | See above |
Other events on the subscribed topics are skipped. One indicator is kept per pair; deploy one worker per interval and parameter set.