tensortrade.oms.instruments.instrument module¶
- class tensortrade.oms.instruments.instrument.Instrument(symbol: str, precision: int, name: str = None)[source]¶
Bases:
object
A financial instrument for use in trading.
- Parameters:
- __eq__(other: Any) bool [source]¶
Checks if two instruments are equal.
- Parameters:
other (Any) – The instrument being compared.
- Returns:
bool – Whether the instruments are equal.
- __ne__(other: Any) bool [source]¶
Checks if two instruments are not equal.
- Parameters:
other (Any) – The instrument being compared.
- Returns:
bool – Whether the instruments are not equal.
- __rmul__(other: float) Quantity [source]¶
Enables reverse multiplication.
- Parameters:
other (float) – The number used to create a quantity.
- Returns:
Quantity – The quantity created by the number and the instrument involved with this operation.
- __truediv__(other: Instrument) TradingPair [source]¶
Creates a trading pair through division.
- Parameters:
other (Instrument) – The instrument that will be the quote of the pair.
- Returns:
TradingPair – The trading pair created from the two instruments.
- Raises:
InvalidTradingPair – Raised if other is the same instrument as self.
Exception – Raised if other is not an instrument.