tensortrade.env.observers.abstract module

class tensortrade.env.observers.abstract.AbstractObserver(*args, **kwargs)[source]

Bases: SchemeMixin, Component, TimeIndexed

A component to generate an observation at each step of an episode.

Parameters:
  • 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.

abstract has_next() bool[source]

Tells if there is a next observation available. Actually if we still have training data available.

Returns:

True if there is a next observation available, otherwise False.

Return type:

bool

abstract property observation_space: Space

The observation space of the TradingEnv.

Returns:

The gymnasium observation space of the TradingEnv.

Return type:

Space

abstract observe() ObsType[source]

Gets the observation at the current step of an episode.

Returns:

The current observation of the environment.

Return type:

ObsType

registered_name = 'observer'
reset()[source]

Resets the observer.