Skip to content

SimpleMovingAverage

The mean close of the last windowcandles candles of a pair (default 20).

  • Indicator: lib's time-windowed SimpleMovingAverage<DateTimeOffset, DecimalAmount>. A sample is the candle's close at its windowEnd.
  • Window: the oldest sample expires once it is windowcandles × interval older than the newest, which keeps exactly windowcandles consecutive candles. The interval is taken from the first candle of a pair, so deploy one worker per interval. Monthly candles (1mo) 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.candle.closed.BTC_USDT.1m
Output sc.<scenarioid>.indicator.<indicatorname>.changed.<PAIR>
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, lowercase kebab, e.g. sma-20
windowcandles no Number of candles in the window. Default: 20.

Other events on the subscribed topics are skipped. One indicator is kept per pair; deploy one worker per interval and parameter set.