tensortrade.feed.api.float.accumulators module

class tensortrade.feed.api.float.accumulators.CumMax(*args, **kwargs)[source]

Bases: Stream[float]

A stream operator that creates a cumulative maximum of values.

Parameters:

skip_na (bool, default True) – Exclude NA/null values. If a value is NA, the result will be NA.

References

[1] https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.cummax.html

forward() 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.

class tensortrade.feed.api.float.accumulators.CumMin(*args, **kwargs)[source]

Bases: Stream[float]

A stream operator that creates a cumulative minimum of values.

Parameters:

skip_na (bool, default True) – Exclude NA/null values. If a value is NA, the result will be NA.

References

[1] https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.cummin.html

forward() 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.

class tensortrade.feed.api.float.accumulators.CumProd(*args, **kwargs)[source]

Bases: Stream[float]

A stream operator that creates a cumulative product of values.

References

forward() 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.

class tensortrade.feed.api.float.accumulators.CumSum(*args, **kwargs)[source]

Bases: Stream[float]

A stream operator that creates a cumulative sum of values.

References

forward() 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.

tensortrade.feed.api.float.accumulators.cummax(s: Stream[float], skipna: bool = True) Stream[float][source]

Computes the cumulative maximum of a stream.

Parameters:
  • s (Stream[float]) – A float stream.

  • skipna (bool, default True) – Exclude NA/null values. If a value is NA, the result will be NA.

Returns:

Stream[float] – The cumulative maximum stream of s.

tensortrade.feed.api.float.accumulators.cummin(s: Stream[float], skipna: bool = True) Stream[float][source]

Computes the cumulative minimum of a stream.

Parameters:
  • s (Stream[float]) – A float stream.

  • skipna (bool, default True) – Exclude NA/null values. If a value is NA, the result will be NA.

Returns:

Stream[float] – The cumulative minimum stream of s.

tensortrade.feed.api.float.accumulators.cumprod(s: Stream[float]) Stream[float][source]

Computes the cumulative product of a stream.

Parameters:

s (Stream[float]) – A float stream.

Returns:

Stream[float] – The cumulative product stream of s.

tensortrade.feed.api.float.accumulators.cumsum(s: Stream[float]) Stream[float][source]

Computes the cumulative sum of a stream.

Parameters:

s (Stream[float]) – A float stream.

Returns:

Stream[float] – The cumulative sum stream of s.