How rujter/rl-trading-env works
This repository contains two experimental reinforcement-learning trading simulators. In the historical variant, an experiment runner trains and evaluates an agent against daily market data, then saves results for plotting. The synthetic variant instead simulates a price and limit-order market with background trader strategies; its runner likewise trains and evaluates an agent and saves results for plots. The sampled code supports the core execution paths, but the synthetic environment excerpt omits substantial sections, so uncertain internal order-book wiring is not expanded. No README content was provided.
Main entry points: env_combined.py Synthetic environment · historical/run.py Train and evaluate · Combined/run.py Train and evaluate · main.py Historical environment
Components 15
Historical trading
- Train and evaluate
historical/run.py - Historical environment
historical/main.py - Portfolio models
historical/Classes.py - Evaluation results
historical/eval_results.npz
Synthetic market
- Train and evaluate
synthetic/Combined/run.py - Synthetic environment
synthetic/Combined/env_combined.py - Background traders
synthetic/Combined/Tradingbots.py - Market models
synthetic/Combined/Classes.py - Evaluation results
synthetic/Combined/eval_results.npz
Results and charts
- Historical charts
historical/plotonly.py - Synthetic charts
synthetic/Combined/plotonly.py - Chart overlay
synthetic/Combined/Overlayer.py
Other components
- Experimenter
- Yahoo Finance
- Chart images
Connections 15
- Experimenter → Train and evaluate: runs
- Yahoo Finance → Historical environment: provides prices
- Train and evaluate → Historical environment: trains and steps
- Historical environment → Portfolio models: uses models
- Train and evaluate → Evaluation results: writes results
- Evaluation results → Historical charts: loads results
- Experimenter → Train and evaluate: runs
- Train and evaluate → Synthetic environment: trains and steps
- Synthetic environment → Background traders: dispatches traders
- Background traders → Synthetic environment: submits orders
- Synthetic environment → Market models: uses models
- Train and evaluate → Evaluation results: writes results
- Evaluation results → Synthetic charts: loads results
- Synthetic charts → Chart images: writes charts
- Chart overlay → Chart images: writes overlays