tensortrade.oms.orders.trade module

class tensortrade.oms.orders.trade.Trade(order_id: str, step: int, exchange_pair: ExchangePair, side: tensortrade.oms.orders.trade.TradeSide, trade_type: tensortrade.oms.orders.trade.TradeType, quantity: Quantity, price: float, commission: Quantity)[source]

Bases: tensortrade.core.base.TimedIdentifiable

A trade object for use within trading environments.

__init__(order_id: str, step: int, exchange_pair: ExchangePair, side: tensortrade.oms.orders.trade.TradeSide, trade_type: tensortrade.oms.orders.trade.TradeType, quantity: Quantity, price: float, commission: Quantity)[source]
Parameters:
  • order_id – The id of the order that created the trade.
  • step – The timestep the trade was made during the trading episode.
  • exchange_pair – The exchange pair of instruments in the trade.
  • BTC/USDT, ETH/BTC, ADA/BTC, AAPL/USD, NQ1!/USD, CAD/USD, etc) ((e.g.) –
  • side – Whether the quote instrument is being bought or sold.
  • BUY = trade the base_instrument for the quote_instrument in the pair. SELL = trade the quote_instrument for the base_instrument) ((e.g.) –
  • size – The size of the core instrument in the trade.
  • 1000 shares, 6.50 satoshis, 2.3 contracts, etc) ((e.g.) –
  • price – The price paid per quote instrument in terms of the core instrument.
  • 10000 represents $10,000.00 if the base_instrument is "USD") ((e.g.) –
  • commission – The commission paid for the trade in terms of the core instrument.
  • 10000 represents $10,000.00 if the base_instrument is "USD")
base_instrument
commission
is_buy
is_limit_order
is_market_order
is_sell
price
quote_instrument
size
to_dict()[source]
to_json()[source]
class tensortrade.oms.orders.trade.TradeSide[source]

Bases: enum.Enum

An enumeration.

BUY = 'buy'
SELL = 'sell'
instrument(pair: TradingPair) → Instrument[source]
class tensortrade.oms.orders.trade.TradeType[source]

Bases: enum.Enum

An enumeration.

LIMIT = 'limit'
MARKET = 'market'