tensortrade.env.observers.window module¶
- class tensortrade.env.observers.window.WindowObserver(*args, **kwargs)[source]¶
Bases:
AbstractObserver
An observer that allows to use an observation window.
This observer can use an observation window. It allows to show the data including the history to an environment. This can help the agent to see patterns over the time and use this information to do better decisions.
Note
There are other ways to add knowledge about how features change in times to an environment. You could also use options like frame stacking as example in Stable-Baselines3. The recommendation is to use only one way to add information about how features change in time.
- Parameters:
window_size (int) – The size of the observation window.
observation_dtype (TypeAlias) – The data type of the observation. Defaults to
np.float32
.observation_lows (float) – The lowest value of the observation. Defaults to
-np.inf
.observation_highs (float) – The highest value of the observation. Defaults to
np.inf
.
- has_next() bool [source]¶
Checks if another observation can be generated.
- Returns:
True if another observation can be generated.
- Return type:
- property observation_space: Space¶
The observation space of the
TradingEnv
.- Returns:
The gymnasium observation space of the
TradingEnv
.- Return type:
Space
- observe() ObsType [source]¶
Observes the environment.
This will add the actual state to the history and return the window of observations.
- Returns:
The current observation window.
- Return type:
ObsType
- registered_name = 'default_observer'¶