Mela, a startup, aims to simplify cryptocurrency trading for everyone and provide reliable investment sources while mitigating risks. This project is focused on designing and building a reliable, large-scale trading data pipeline that can run various backtests and store useful artifacts in a robust data warehouse.
- Run Multiple Backtests: Utilize various technical indicators and assets to perform backtests.
- Design Database Schema: Store backtest artifacts in a well-structured database.
- Integrate MLOps Tools: Use Apache Kafka, Airflow, MLflow, and CML.
- Build Frontend: Create an interface for users to run backtests.
- Test Pipeline: Ensure the pipeline's functionality and reliability.
- Skills: Technical analysis, backtesting, trading, data pipeline building, structured streaming, workflow orchestration.
- Knowledge: Financial prediction, enterprise-grade data engineering using Apache and Databricks tools.
- Python Programming
- SQL Programming
- Data & Analytics Engineering
- MLOps
- Software Development Frameworks
git clone https://github.com/dev-abuke/Scalable_Backtesting_Infrastructure_for_Crypto_Trading.git
cd Scalable_Backtesting_Infrastructure_for_Crypto_Trading
Create a virtual environment for the project
python -m venv env
source env/bin/activate # On Windows, use `env\Scripts\activate`
Install necessary packages
pip install -r requirements.txt
├── backend/
│ ├── main.py
│ ├── models.py
│ ├── schemas.py
│ ├── database.py
│ ├── auth.py
│ ├── requirements.txt
│ ├── README.md
│ └── scripts
│ ├── backtesting
│ ├── init_data.py
│ ├── kafka_config.py
│ │ ├── main.py
│ └── init_db.py
├── scripts/
│ └── download_data.py
├── tests/
├── .github/
│ └── workflows/
│ └── ci.yml
├── requirements.txt
└── README.md
If you do not have Kafka installed, you can run it using Docker:
docker run -d --name zookeeper -p 2181:2181 zookeeper:3.4.9 docker run -d --name kafka -p 9092:9092 --link zookeeper wurstmeister/kafka:latest
Alternatively, follow the Kafka Quickstart guide to set up Kafka.
Create a .env
file in the root directory and add the following configurations:
- KAFKA_BROKER_URL=localhost:9092
- SCENE_TOPIC=scene_parameters
- RESULT_TOPIC=backtest_results
python -m scripts.init_db
uvicorn main:app --reload
Use a tool like Postman, Thunder Client, or Curl to interact with the API.
GET /health
POST /indicators/
Body
{
"name": "Simple Moving Average",
"symbol": "SMA",
"description": "A simple moving average indicator"
}
GET /indicators/
POST /stocks/
Body
{
"name": "Apple Inc.",
"symbol": "AAPL",
"description": "Apple Inc. stock"
}
GET /stocks/
POST /scenes/
Body
{
"period": 20,
"indicator_id": 1,
"stock_id": 1,
"start_date": "2023-01-01",
"end_date": "2023-12-31"
}
GET /scenes/
POST /backtests/{scene_id}
GET /backtest_results/
- Abubeker Shamil
- Michael George
This project is licensed under the MIT License - see the LICENSE file for details.
Instructors
- Yabebal
- Nathnael
- Emtinan
- Rehmet
References: backtrader, Freqtrade, Vectorbt, Kafka, Airflow, MLflow, CML