tensortrade.env.mixins.scheme module¶
- class tensortrade.env.mixins.scheme.SchemeMixin[source]¶
Bases:
object
A mixin class that provides managed access to a
TradingEnv
instance.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
TradingEnv
instance, defaults to None
- property trading_env: TradingEnv¶
Provides access to the
TradingEnv
instance.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
TradingEnv
instance.- Return type:
- Raises:
ValueError – If _trading_env is not initialized.