tensortrade.env.utils.feed_controller module¶
- class tensortrade.env.utils.feed_controller.FeedController(feed: DataFeed, portfolio: Portfolio)[source]¶
Bases:
Observable
,TimeIndexed
This class is responsible for controlling the global feed in a
TradingEnv
.The
FeedController
prepares the feed on initialization and provides access to the features, metadata and portfolio data. It has to be reset when the environment is reset and for new datanext()
has to be executed.Note
- The feed need to be a group of streams compiled together to a
DataFeed
. It should consists of: features (Group): The features shown to the environment as observation for learning. This data should be normalized and prepared for the environment. If it’s missing a
ValueError
is raised.meta (Group): The metadata used by the components, like plotters or plotters. This contains data like raw ohlcv data. It can be omitted but this will display a warning.
- Parameters:
- static create_portfolio_streams(portfolio: Portfolio) List[Stream[float]] [source]¶
Creates a list of streams to describe a
Portfolio
.
- static create_wallet_source(wallet: Wallet, include_worth: bool = True) List[Stream[float]] [source]¶
Creates a list of streams to describe a
Wallet
.
- property features_len: int¶
Gets the number of available features for training the model.
- Returns:
The number of features.
- Return type:
- property features_size: int¶
Gets the number of features per state.
- Returns:
The number of features per state.
- Return type:
- has_next() bool [source]¶
Checks if there is more data available.
- Returns:
Whether there is new data available.
- Return type:
- property meta_history: DataFrame¶
Gets the metadata history of this episode.
- Returns:
The metadata history.
- Return type:
DataFrame
- The feed need to be a group of streams compiled together to a