RelativeReturn
The simple (relative) return of a pair's closes over lagcandles candles (the lag, default 1): (close − close N candles ago) / close N candles ago.
- Indicator: lib's
Returns.RelativeReturnover the closes (asdouble), wrapped inWarmUp. - Warm-up: until N + 1 candles are seen there is no return. The changed event carries
{ "value": null }, and the same is saved, instead of an error. - Value:
{ "value": 0.0015 }, a fraction, unitless —0.0015is +0.15 %. - Not the absolute return:
AbsoluteReturnpublishes the price differenceclose − close N candles ago;LogReturnpublishesln(close / close N candles ago). The three agree to first order for small moves and diverge for large ones.
| Property | Value |
|---|---|
| Project | Virtufin.Worker.RelativeReturn |
| 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, e.g. relativereturn |
lagcandles |
no | Lag in candles: how many candles back to compare against. Default: 1. |
Other events on the subscribed topics are skipped. One indicator is kept per pair; deploy one worker per interval and parameter set.