Files
mt5-ai-xauusd-trader/.jules
LeoGitHubgoogle-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>triqbit
4eb06a5948 ⚡ Bolt: optimize TradingEnv observation generation (#363)
Optimized `TradingEnv._get_observation` in `src/environment/gym_env.py` by:
1. Pre-calculating rolling means and standard deviations in `__init__` using Pandas.
2. Using a pre-allocated observation buffer to avoid repeated memory allocations.
3. Vectorizing the normalization process.

Measurably faster: Increased observation generation speed from ~12k steps/s to ~67k steps/s (~5.5x speedup).

Verified with `tests/test_env_consistency.py` to ensure optimized output matches the original implementation exactly.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: triqbit <242833443+triqbit@users.noreply.github.com>
2026-05-01 09:26:32 +00:00
..