Skip to content

@livefolio/sdk / PollingStreamOptions

Type Alias: PollingStreamOptions

PollingStreamOptions = object

Defined in: reference/polling-stream-from-historical.ts:8

Properties

feed

feed: DataFeed

Defined in: reference/polling-stream-from-historical.ts:10

Historical feed to poll. Each tick of the schedule calls feed.bars(asset, …) for each subscribed asset.


freq

freq: Frequency

Defined in: reference/polling-stream-from-historical.ts:12

Bar frequency to request. Single value — multi-frequency requires composing two polling streams via RoutingStreamingDataFeed.


initialFrom?

optional initialFrom?: Date

Defined in: reference/polling-stream-from-historical.ts:22

Window-start for the first poll per asset. Subsequent polls fetch (lastSeenT, now] per asset. Defaults to new Date(0) — every bar the feed has on the first poll is yielded. For replay-then-stream, set this to your backtest range's to so polling picks up exactly where the backtest left off.


now?

optional now?: () => Date

Defined in: reference/polling-stream-from-historical.ts:24

Inject for tests or for accelerated-time simulations. Defaults to () => new Date().

Returns

Date


schedule

schedule: PollingSchedule

Defined in: reference/polling-stream-from-historical.ts:14

When to poll.


sleep?

optional sleep?: (ms) => Promise<void>

Defined in: reference/polling-stream-from-historical.ts:26

Inject for tests or for accelerated-time simulations. Defaults to setTimeout-based promise.

Parameters

ParameterType
msnumber

Returns

Promise<void>

Released under the MIT License.