Skip to content

circumflex3105/Paper-Trading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Paper Trading

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.

Requirements

  • Python 3.8+
  • Install dependencies from requirements.txt

Installation

git clone https://github.com/yourusername/paper_trading.git
cd paper_trading
pip install -r requirements.txt

Usage

Live Trading Mode

python src/main.py --starting-eur 1000 --interval 5

Notes

  1. The --starting-eur parameter sets the initial demo balance in EUR (default 1000,-€).
  2. The --interval parameter specifies the refresh interval in seconds for live mode.

Backtesting Mode

python src/main.py --starting-eur 1000 --interval 5 --backtesting --start-date 2022-01-01 --end-date 2022-01-31

Notes

  1. The --starting-eur parameter sets the initial demo balance in EUR (default 1000,-€).
  2. The --interval parameter specifies the candle interval in minutes for backtesting mode.
  3. The --backtesting flag enables backtesting mode.
  4. The --start-date parameter sets the start date (format: YYYY-MM-DD). If not provided, defaults to the earliest available date.
  5. The --end-date parameter sets the end date (format: YYYY-MM-DD). If not provided, defaults to the latest available date.

Data

The curent dataset only includes data up to Q2 2025 (2025-06-30).

Adding new Trading Pairs

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.

Updating Data

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.

Notes

  1. The data files from Kraken are named like XBTEUR_1.csv for 1-minute interval data of the XBTEUR trading pair. In this repository, the files are renamed to 1.csv and placed in a folder named after the trading pair (e.g., data/XBTEUR/1.csv).
  2. The intervals 30 and 240 are not used, since they start significantly later than the other intervals.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages