This project provides a Streamlit interface for training a transformer-based model that forecasts ETH/USDT candle movements and simulates trading behaviour with a configurable budget. The trainer automatically checkpoints state every 10 minutes (configurable) and whenever you stop the session, ensuring you can pause and resume long-running experiments without losing progress.
- State-of-the-art transformer backbone optimised to predict OHLCV values and trade actions simultaneously.
- Live ETH/USDT data download from Binance using
ccxt. - Reward shaping that combines price prediction accuracy with simulated trading performance including commission costs.
- Streamlit dashboard to start/stop/resume training, tune hyperparameters and review budget, profit and accuracy metrics in real time.
- Auto-checkpointing every 10 minutes and on shutdown with manual save support.
- Resume from checkpoint at any time, even after closing the application.
- Install dependencies (Python 3.10+ recommended):
pip install -r requirements.txt
- Launch the Streamlit dashboard:
streamlit run app/streamlit_app.py
- Pick your desired timeframe, budget and other hyperparameters from the sidebar, then press Start training.
- Use Stop training to pause – training state is saved automatically.
- Resume training with Resume from checkpoint or trigger Manual checkpoint at any time.
Note: The trainer downloads live data from Binance. Ensure your environment allows outbound HTTPS connections. Training can run indefinitely (up to the configured epoch count) and is optimised for week-long sessions.
app/data.py– Candle download and preprocessing helpers.app/model.py– Transformer architecture.app/trainer.py– Training loop, checkpointing and threading utilities.app/streamlit_app.py– Streamlit UI for controlling the trainer.requirements.txt– Runtime dependencies.
A quick sanity check that all modules compile:
python -m compileall app