tensortrade.exchanges.live.ccxt_exchange module

class tensortrade.exchanges.live.ccxt_exchange.CCXTExchange(exchange, **kwargs)[source]

Bases: tensortrade.exchanges.instrument_exchange.InstrumentExchange

An instrument exchange for trading on CCXT-supported cryptocurrency exchanges.

property balance

The current balance of the base symbol on the exchange.

Return type

float

property base_precision

The floating point precision of the base instrument.

Return type

float

current_price(symbol)[source]

The current price of an instrument on the exchange, denoted in the base instrument.

Parameters

symbol (str) – The exchange symbol of the instrument to get the price for.

Return type

float

Returns

The current price of the specified instrument, denoted in the base instrument.

execute_trade(trade)[source]

Execute a trade on the exchange, accounting for slippage.

Parameters

trade (Trade) – The trade to execute.

Return type

Trade

Returns

The filled trade.

property generated_space

The initial shape of the observations generated by the exchange, before feature transformations.

Return type

Space

property has_next_observation

If False, the exchange’s data source has run out of observations.

Resetting the exchange may be necessary to continue generating observations.

Return type

bool

Returns

Whether or not the specified instrument has a next observation.

property initial_balance

The initial balance of the base symbol on the exchange.

Return type

float

property instrument_precision

The floating point precision of the instrument to be traded.

Return type

float

property performance

The performance of the active account on the exchange since the last reset.

Return type

DataFrame

property portfolio

The current balance of each symbol on the exchange (non-positive balances excluded).

Return type

Dict[str, float]

reset()[source]

Reset the feature pipeline, initial balance, trades, performance, and any other temporary stateful data.

property trades

A list of trades made on the exchange since the last reset.

Return type

List[Trade]