tensortrade.feed.core.feed module

class tensortrade.feed.core.feed.DataFeed(streams: List[tensortrade.feed.core.base.Stream])[source]

Bases: tensortrade.feed.core.base.Stream

A stream the compiles together streams to be run in an organized manner.

Parameters:streams (List[Stream]) – A list of streams to be used in the data feed.
compile() → None[source]

Compiles all the given stream together.

Organizes the order in which streams should be run to get valid output.

forward() → dict[source]

Generates the next value from the underlying data streams.

Returns:T – The next value in the stream.
has_next() → bool[source]

Checks if there is another value.

Returns:bool – If there is another value or not.
next() → dict[source]
reset() → None[source]

Resets all inputs to and listeners of the stream and sets stream value to None.

run() → None[source]

Runs all the streams in processing order.

class tensortrade.feed.core.feed.PushFeed(streams: List[tensortrade.feed.core.base.Stream])[source]

Bases: tensortrade.feed.core.feed.DataFeed

A data feed for working with live data in an online manner.

All sources of data to be used with this feed must be a Placeholder. This ensures that the user can wait until all of their data has been loaded for the next time step.

Parameters:streams (List[Stream]) – A list of streams to be used in the data feed.
next() → dict[source]
push(data: dict) → dict[source]

Generates the values from the data feed based on the values being provided in data.

Parameters:data (dict) – The data to be pushed to each of the placholders in the feed.
Returns:dict – The next data point generated from the feed based on data.