tensortrade.exchanges.simulated.simulated_exchange module¶
-
class
tensortrade.exchanges.simulated.simulated_exchange.
SimulatedExchange
(data_frame=None, **kwargs)[source]¶ Bases:
tensortrade.exchanges.instrument_exchange.InstrumentExchange
An instrument exchange, in which the price history is based off the supplied data frame and trade execution is largely decided by the designated slippage model.
If the data_frame parameter is not supplied upon initialization, it must be set before the exchange can be used within a trading environment.
-
current_price
(symbol)[source]¶ The current price of an instrument on the exchange, denoted in the base instrument.
-
property
data_frame
¶ The underlying data model backing the price and volume simulation.
- Return type
DataFrame
-
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
- Returns
Whether or not the specified instrument has a next observation.
-
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).
-
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
DataFrame
-