This project is a robust trading and backtesting infrastructure designed to support the evaluation of various trading strategies on financial instruments like stocks and cryptocurrencies. It leverages a microservices architecture with Docker for flexibility and scalability, using tools like Airflow, Kafka, FastAPI, and PostgreSQL.
yfinance
, processes it, and stores it in a PostgreSQL database.airflow/
: Contains Airflow DAGs for orchestrating data pipelines and backtests.api/
: Houses the FastAPI backend service.database_service/
: Contains the database service logic for data access and storage.kafka_consumer/
: Holds the Kafka consumer service for data ingestion.models/
: Defines the SQLAlchemy models for the database schema.shared/
: Stores shared modules (e.g., utility functions, configurations).src/
: Contains source code for data fetching, backtesting logic, and strategies.tests/
: Includes unit and integration tests for the project.requirements.txt
)git clone
In your terminal:
cd Backtesting-Infrastructure-CryptoTrading
pip install -r requirements.txt
In your terminal run:
make up
This will start the services in compose.yaml file. You can check the status of the services by running:
docker ps
To check the logs of a service, run:
docker compose logs -f <service_name>
Where the service_name is the name of the service found in the compose.yaml file.
Example of checking the logs of the api service:
docker compose logs -f api
docker compose logs -f kafka-consumer
This project is licensed under the Apache License 2.0. See the LICENSE
file for details.