tensortrade.env.mixins.scheme module¶
- class tensortrade.env.mixins.scheme.SchemeMixin[source]¶
Bases:
objectA mixin class that provides managed access to a
TradingEnvinstance.This mixin ensures that any class inheriting from it has a trading_env attribute that is properly initialized before use. The trading_env attribute is managed through a property to enforce this initialization check.
- Parameters:
_trading_env (Optional[TradingEnv]) – A
TradingEnvinstance, defaults to None
- property trading_env: TradingEnv¶
Provides access to the
TradingEnvinstance.This property checks whether _trading_env has been initialized. If _trading_env is None, a ValueError is raised to prevent the use of an uninitialized
TradingEnv.- Returns:
The initialized
TradingEnvinstance.- Return type:
- Raises:
ValueError – If _trading_env is not initialized.