Broker-agnostic market-data source. The chart depends only on this. subscribeBars is optional: a history-only feed (e.g. OpenAlgoDataFeed) omits it, while a live feed (OpenAlgoLiveDataFeed, or your own) implements it.

Implements

Constructors

Methods

  • Live bars: WS tick -> aggregator -> onBar (mutated/append bar). The tick stream is LTP, or Quote when volumeMode is 'day-delta' and the bar therefore needs a cumulative day volume.

    Fixed intervals go through CandleBuilder, which carries the late-tick policy; calendar, tick-count and volume intervals go through TickBarAggregator, which is the one that knows those boundaries.

    Pass opts.seedFrom (the last history bar) to continue that bar's bucket seamlessly instead of starting a fresh one, and opts.cumDayVolumeSoFar so a day-delta builder diffs against the right baseline. Seeding applies to time-bucketed intervals: a count-driven bar cannot resume a historical one.

    Parameters

    Returns UnsubscribeFn

  • Live book. opts.depthLevel requests a book depth (broker-dependent: 5/20/30/50), falling back to the feed's configured default and then to whatever the broker sends unasked, which is what this method always did. The socket has accepted a depth level all along; only the composed feed had no way to name one.

    Parameters

    Returns UnsubscribeFn