tensortrade.orders.trade module¶
-
class
tensortrade.orders.trade.
Trade
(order_id, exchange_id, step, pair, side, trade_type, quantity, price, commission)[source]¶ Bases:
tensortrade.base.core.TimedIdentifiable
A trade object for use within trading environments.
-
__init__
(order_id, exchange_id, step, pair, side, trade_type, quantity, price, commission)[source]¶ Parameters: - order_id (
str
) – The id of the order that created the trade. - exchange_id (
str
) – The id of the exchange the trade was executed on. - step (
int
) – The timestep the trade was made during the trading episode. - pair (TradingPair) – The trading pair of the instruments in the trade.
- BTC/USDT, ETH/BTC, ADA/BTC, AAPL/USD, NQ1!/USD, CAD/USD, etc) ((e.g.) –
- side (
TradeSide
) – 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 base instrument in the trade.
- 1000 shares, 6.50 satoshis, 2.3 contracts, etc) ((e.g.) –
- price (
float
) – The price paid per quote instrument in terms of the base instrument. - 10000 represents $10,000.00 if the base_instrument is "USD") ((e.g.) –
- commission (Quantity) – The commission paid for the trade in terms of the base instrument.
- 10000 represents $10,000.00 if the base_instrument is "USD") –
- order_id (
-
base_instrument
¶ Return type: Instrument
-
quote_instrument
¶ Return type: Instrument
-