stateful_trading_env ==================== .. py:module:: stateful_trading_env Classes ------- .. autoapisummary:: stateful_trading_env.StatefulTradingEnv Module Contents --------------- .. py:class:: StatefulTradingEnv(data, cfg, features, time_step = (TimeFrameUnit.Day, 1), position_manager = None) Bases: :py:obj:`trading.src.alg.environments.base_environment.BaseTradingEnv` Stateful trading environment for backtesting and paper trading. Maintains full portfolio state, position tracking, and enforces trading constraints. This is the environment that should be used for realistic testing and evaluation. .. py:attribute:: pf :type: trading.src.portfolio.portfolio.Portfolio .. py:attribute:: reward_function .. py:attribute:: stats .. py:method:: _get_observation(i = -1) Get the current observation with full portfolio state. .. py:method:: _reset_internal_states(timestamp = None) Reset internal states including portfolio. .. py:method:: reset(*, timestamp = None, seed = None, options = None) Reset the environment to its initial state. .. py:method:: render() Render environment state with portfolio information. .. py:method:: step(action) Execute one time step with full portfolio management. This includes position tracking, trade enforcement, and proper reward calculation.