Skip to content

Indicator styles

Choose the right one for your use case

Feature comparison ​

The library provides three distinct indicator styles to support different use cases.

FeatureBatch (Series)Buffer listsStream hubs
Incrementingnoyesyes
Batch speedfastestfasterfast
Scalinglowmoderatehigh
Class typestaticinstanceinstance
Base interfaceIReadOnlyListIReadOnlyList (+ Add)IStreamHub
Complexitylowestmoderatehighest
Chainableyesmanualyes
Pruningwith utilityauto-presetauto-preset
Healingnonoyes

Healing: Built-in handling of out-of-order and de-deplication of incoming data.

Which style to use? ​

Start with Batch (Series) style unless you have a specific need for incremental processing or real-time streaming.

  • Use Batch when you have a complete historical dataset and need to calculate indicators once. Fastest and simplest.
  • Use Buffer lists when bars arrive one at a time and you need incremental processing without the overhead of a full hub infrastructure.
  • Use Stream hubs when you need coordinated, automatic updates across multiple chained indicators from a live data feed with self-healing.

Bars that arrive one at a time ​

Don't re-run a Series method for every new bar. Its cost grows with the history it recalculates, while a stream hub's cost per new bar stays flat. For EMA, SMA, RSI and MACD, the hub is already cheaper once the history passes about 12 to 20 bars, and at 1,000 bars the Series method costs 40 to 110 times as much per bar. To measure it on your own hardware, run the StreamCrossover benchmark in tools/performance.

Getting started ​

See Getting started for installation, first steps, and example usage.