This repository can be used to simulate the crypto market. It has a mode for live trading on a demo exchange and another mode for backtesting, where a historical time period can be simulated.
- Python 3.8+
- Install dependencies from
requirements.txt
git clone https://github.com/yourusername/paper_trading.git
cd paper_trading
pip install -r requirements.txtpython src/main.py --starting-eur 1000 --interval 5- The
--starting-eurparameter sets the initial demo balance in EUR (default 1000,-€). - The
--intervalparameter specifies the refresh interval in seconds for live mode.
python src/main.py --starting-eur 1000 --interval 5 --backtesting --start-date 2022-01-01 --end-date 2022-01-31- The
--starting-eurparameter sets the initial demo balance in EUR (default 1000,-€). - The
--intervalparameter specifies the candle interval in minutes for backtesting mode. - The
--backtestingflag enables backtesting mode. - The
--start-dateparameter sets the start date (format: YYYY-MM-DD). If not provided, defaults to the earliest available date. - The
--end-dateparameter sets the end date (format: YYYY-MM-DD). If not provided, defaults to the latest available date.
The curent dataset only includes data up to Q2 2025 (2025-06-30).
To add new trading pairs, create a new folder in the data directory with the name of the trading pair (e.g., ETHUSD). Then, download the historical data for that trading pair from here and place the CSV files in the newly created folder. The CSV files should be named like 1.csv for 1-minute interval data of the ETHUSD trading pair.
Kraken provides besides the full historical dataset new data each quarter. You can download the new data from here and add it to the data folder. This can be done by opening the downloaded CSV files and appending the new data to the existing CSV files in the data folder. The CSV files are originally named like XBTEUR_1.csv for 1-minute interval data of the XBTEUR trading pair.
- The data files from Kraken are named like
XBTEUR_1.csvfor 1-minute interval data of the XBTEUR trading pair. In this repository, the files are renamed to1.csvand placed in a folder named after the trading pair (e.g.,data/XBTEUR/1.csv). - The intervals 30 and 240 are not used, since they start significantly later than the other intervals.