tensortrade.feed.api.float.window.rolling module¶
rolling.py contains functions and classes for rolling stream operations.
- class tensortrade.feed.api.float.window.rolling.Rolling(*args, **kwargs)[source]¶
-
A stream that generates a rolling window of values from a stream.
- Parameters:
- agg(func: Callable[[List[float]], float]) Stream[float] [source]¶
Computes an aggregation of a rolling window of values.
- Parameters:
func (Callable[[List[float]], float]) – A aggregation function.
- Returns:
Stream[float] – A stream producing aggregations of a rolling window of values.
- count() Stream[float] [source]¶
Computes a rolling count from the underlying stream.
- Returns:
Stream[float] – A rolling count stream.
- forward() List[float] [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.
- max() Stream[float] [source]¶
Computes a rolling maximum from the underlying stream.
- Returns:
Stream[float] – A rolling maximum stream.
- mean() Stream[float] [source]¶
Computes a rolling mean from the underlying stream.
- Returns:
Stream[float] – A rolling mean stream.
- median() Stream[float] [source]¶
Computes a rolling median from the underlying stream.
- Returns:
Stream[float] – A rolling median stream.
- min() Stream[float] [source]¶
Computes a rolling minimum from the underlying stream.
- Returns:
Stream[float] – A rolling minimum stream.
- reset() None [source]¶
Resets all inputs to and listeners of the stream and sets stream value to None.
- std() Stream[float] [source]¶
Computes a rolling standard deviation from the underlying stream.
- Returns:
Stream[float] – A rolling standard deviation stream.
- class tensortrade.feed.api.float.window.rolling.RollingCount(*args, **kwargs)[source]¶
Bases:
RollingNode
A stream operator that counts the number of non-missing values in the rolling window.
- class tensortrade.feed.api.float.window.rolling.RollingNode(*args, **kwargs)[source]¶
-
A stream operator for aggregating a rolling window of a stream.
- Parameters:
func (Callable[[List[float]], float]) – A function that aggregates a rolling window.
- forward() float [source]¶
Generates the next value from the underlying data streams.
- Returns:
T – The next value in the stream.