tensortrade.exchanges.exchange module

class tensortrade.exchanges.exchange.Exchange(name, service, options=None)[source]

Bases: tensortrade.data.stream.node.Module, tensortrade.base.component.Component, tensortrade.base.core.TimedIdentifiable

An abstract exchange for use within a trading environment.

build()[source]
execute_order(order, portfolio)[source]

Execute an order on the exchange.

Parameters:
  • order (Order) – The order to execute.
  • portfolio (Portfolio) – The portfolio to use.
has_next()[source]
is_pair_tradable(trading_pair)[source]

Whether or not the specified trading pair is tradable on this exchange.

Parameters:trading_pair (TradingPair) – The TradingPair to test the tradability of.
Return type:bool
Returns:A bool designating whether or not the pair is tradable.
options
quote_price(trading_pair)[source]

The quote price of a trading pair on the exchange, denoted in the base instrument.

Parameters:trading_pair (TradingPair) – The TradingPair to get the quote price for.
Return type:float
Returns:The quote price of the specified trading pair, denoted in the base instrument.
registered_name = 'exchanges'
reset()[source]
class tensortrade.exchanges.exchange.ExchangeOptions(commission=0.003, min_trade_size=1e-06, max_trade_size=1000000.0, min_trade_price=1e-08, max_trade_price=100000000.0, is_live=False)[source]

Bases: object