operations.py contains functions for computing arithmetic operations on float streams.

tensortrade.feed.api.float.operations.abs(s: tensortrade.feed.core.base.Stream[float][float]) → tensortrade.feed.core.base.Stream[float][float][source]

Computes the absolute value of a float stream.

Parameters: s (Stream[float]) – A float stream. Stream[float] – The absolute value stream of s.
tensortrade.feed.api.float.operations.add(s1: tensortrade.feed.core.base.Stream[float][float], s2: tensortrade.feed.core.base.Stream[float][float]) → tensortrade.feed.core.base.Stream[float][float][source]

Computes the addition of two float streams.

Parameters: s1 (Stream[float]) – The first float stream. s2 (Stream[float] or float) – The second float stream. Stream[float] – A stream created from adding s1 and s2.
tensortrade.feed.api.float.operations.mul(s1: tensortrade.feed.core.base.Stream[float][float], s2: tensortrade.feed.core.base.Stream[float][float]) → tensortrade.feed.core.base.Stream[float][float][source]

Computes the multiplication of two float streams.

Parameters: s1 (Stream[float]) – The first float stream. s2 (Stream[float] or float) – The second float stream. Stream[float] – A stream created from multiplying s1 and s2.
tensortrade.feed.api.float.operations.neg(s: tensortrade.feed.core.base.Stream[float][float]) → tensortrade.feed.core.base.Stream[float][float][source]

Computes the negation of a float stream.

Parameters: s (Stream[float]) – A float stream. Stream[float] – The negated stream of s.
tensortrade.feed.api.float.operations.pow(s: tensortrade.feed.core.base.Stream[float][float], power: float) → tensortrade.feed.core.base.Stream[float][float][source]

Computes the power of a float stream.

Parameters: s (Stream[float]) – A float stream. power (float) – The power to raise s by. Stream[float] – The power stream of s.
tensortrade.feed.api.float.operations.radd(s1: tensortrade.feed.core.base.Stream[float][float], s2: tensortrade.feed.core.base.Stream[float][float]) → tensortrade.feed.core.base.Stream[float][float][source]

Computes the reversed addition of two float streams.

Parameters: s1 (Stream[float]) – The first float stream. s2 (Stream[float] or float) – The second float stream. Stream[float] – A stream created from adding s1 and s2.
tensortrade.feed.api.float.operations.rmul(s1: tensortrade.feed.core.base.Stream[float][float], s2: tensortrade.feed.core.base.Stream[float][float]) → tensortrade.feed.core.base.Stream[float][float][source]

Computes the reverse multiplication of two float streams.

Parameters: s1 (Stream[float]) – The first float stream. s2 (Stream[float] or float) – The second float stream. Stream[float] – A stream created from multiplying s2 and s1.
tensortrade.feed.api.float.operations.rsub(s1: tensortrade.feed.core.base.Stream[float][float], s2: tensortrade.feed.core.base.Stream[float][float]) → tensortrade.feed.core.base.Stream[float][float][source]

Computes the reverse subtraction of two float streams.

Parameters: s1 (Stream[float]) – The first float stream. s2 (Stream[float] or float) – The second float stream. Stream[float] – A stream created from subtracting s1 from s2.
tensortrade.feed.api.float.operations.rtruediv(s1: tensortrade.feed.core.base.Stream[float][float], s2: tensortrade.feed.core.base.Stream[float][float]) → tensortrade.feed.core.base.Stream[float][float][source]

Computes the reverse division of two float streams.

Parameters: s1 (Stream[float]) – The first float stream. s2 (Stream[float] or float) – The second float stream. Stream[float] – A stream created from dividing s2 by s1.
tensortrade.feed.api.float.operations.sub(s1: tensortrade.feed.core.base.Stream[float][float], s2: tensortrade.feed.core.base.Stream[float][float]) → tensortrade.feed.core.base.Stream[float][float][source]

Computes the subtraction of two float streams.

Parameters: s1 (Stream[float]) – The first float stream. s2 (Stream[float] or float) – The second float stream. Stream[float] – A stream created from subtracting s2 from s1.
tensortrade.feed.api.float.operations.truediv(s1: tensortrade.feed.core.base.Stream[float][float], s2: tensortrade.feed.core.base.Stream[float][float]) → tensortrade.feed.core.base.Stream[float][float][source]

Computes the division of two float streams.

Parameters: s1 (Stream[float]) – The first float stream. s2 (Stream[float] or float) – The second float stream. Stream[float] – A stream created from dividing s1 by s2.