tensortrade.env.default.observers module¶
-
class
tensortrade.env.default.observers.ObservationHistory(window_size: int)[source]¶ Bases:
objectStores observations from a given episode of the environment.
- Parameters
window_size (int) – The amount of observations to keep stored before discarding them.
-
rows¶ The rows of observations that are used as the environment observation at each step of an episode.
- Type
pd.DataFrame
-
observe() → numpy.array[source]¶ Gets the observation at a given step in an episode
- Returns
np.array – The current observation of the environment.
-
class
tensortrade.env.default.observers.TensorTradeObserver(*args, **kwargs)[source]¶ Bases:
tensortrade.env.generic.components.observer.ObserverThe TensorTrade observer that is compatible with the other default components.
- Parameters
portfolio (Portfolio) – The portfolio to be used to create the internal data feed mechanism.
feed (DataFeed) – The feed to be used to collect observations to the observation window.
renderer_feed (DataFeed) – The feed to be used for giving information to the renderer.
window_size (int) – The size of the observation window.
min_periods (int) – The amount of steps needed to warmup the feed.
**kwargs (keyword arguments) – Additional keyword arguments for observer creation.
-
feed¶ The master feed in charge of streaming the internal, external, and renderer data feeds.
- Type
DataFeed
-
history¶ The observation history.
- Type
ObservationHistory
-
renderer_history¶ The history of the renderer data feed.
- Type
List[dict]
-
has_next() → bool[source]¶ Checks if there is another observation to be generated.
- Returns
bool – Whether there is another observation to be generated.
-
property
observation_space¶ The observation space of the TradingEnv. (Space, read-only)