Skip to content

Commit

Permalink
Merge pull request #1 from 10-academy-w-9/initial-setup
Browse files Browse the repository at this point in the history
Initial project setup
  • Loading branch information
AbYT101 committed Jun 20, 2024
2 parents 18415f0 + b788223 commit 7217127
Show file tree
Hide file tree
Showing 37 changed files with 141 additions and 2 deletions.
Empty file added .github/ISSUE_TEMPLATE.md
Empty file.
Empty file added .github/workflows/ci-cd.yml
Empty file.
Empty file added Dockerfile
Empty file.
143 changes: 141 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,141 @@
# backtesting-infrastructure
Crypto Trading Engineering: Scalable Backtesting Infrastructure
# Crypto Trading Backtesting

Crypto Trading Backtesting: Scalable Backtesting Infrastructure for Cryptocurrencies

## Overview
The Crypto Trading Backtesting project aims to provide a robust, large-scale trading data pipeline designed to help users backtest cryptocurrency trading strategies. The system uses historical candlestick data to simulate trades and evaluate strategies, providing valuable insights and reducing the risk associated with trading cryptocurrencies.

## Features

- **Data Ingestion** : Fetches historical candlestick data from Binance and Yahoo Finance.

- **Backtesting Engine**: Utilizes advanced frameworks like Backtrader, Freqtrade, and Vectorbt to simulate trades based on various strategies.

- **Metrics Calculation**: Evaluates strategies using metrics such as returns, number of trades, winning trades, losing trades, max drawdown, and Sharpe ratio.

- **Dynamic Scene Generation**: Automates backtesting runs with customizable parameters.

- **MLOps Integration**: Incorporates tools like Apache Airflow, Kafka, MLflow, and CML for seamless pipeline automation and monitoring.

- **Frontend Interface**: Provides a user-friendly interface for running backtests and viewing results.

## Project Structure

```
crypto-trading-backtesting/
├── .github/
│ ├── workflows/
│ │ └── ci-cd.yml
│ └── ISSUE_TEMPLATE.md
├── airflow/
│ ├── dags/
│ │ ├── backtest_dag.py
│ │ └── monitor_dag.py
│ └── plugins/
├── app/
│ ├── __init__.py
│ ├── main.py
│ ├── models/
│ │ ├── backtest.py
│ │ └── user.py
│ ├── routes/
│ │ ├── auth.py
│ │ ├── backtest.py
│ │ └── index.py
│ ├── services/
│ │ ├── backtest_service.py
│ │ ├── kafka_service.py
│ │ └── mlflow_service.py
│ └── templates/
│ └── index.html
├── config/
│ ├── airflow.cfg
│ ├── config.py
│ ├── kafka-config.yaml
│ └── mlflow-config.yaml
├── data/
│ ├── raw/
│ ├── processed/
│ └── backtests/
├── docs/
│ ├── README.md
│ ├── DESIGN.md
│ └── USAGE.md
├── notebooks/
│ ├── data_exploration.ipynb
│ ├── backtesting.ipynb
│ └── model_training.ipynb
├── scripts/
│ ├── backtest_runner.py
│ ├── data_ingestion.py
│ └── model_training.py
├── tests/
│ ├── unit/
│ │ ├── test_backtest_service.py
│ │ ├── test_kafka_service.py
│ │ └── test_mlflow_service.py
│ ├── integration/
│ │ ├── test_end_to_end.py
│ └── conftest.py
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
└── setup.py
```

### Installation

1. **Clone the repository:**

```sh
git clone [email protected]:your-username/crypto_trading_backtesting.git
cd crypto_trading_backtesting
```

2. **Set up a virtual environment:**

```sh
python3 -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
```
3. **Install Requirements:**
```sh
pip install -r requirements.txt
```
4. **Run Streamlit interface**
```sh
streamlit run src/frontend/app.py
```

## Usage
1. **Provide input descriptions** of the trading strategies, including scenarios and expected outputs.

2. **Run the backtesting system** to simulate trades and evaluate strategies.
3. **Review the generated metrics** to assess the performance of different trading strategies.
4. **Select the desired strategies** for further use or real-time trading.

## License

This project is licensed under the MIT License.


## Contributors

- [@abyt101](https://github.com/AbYT101) - Abraham Teka
- Temesgen Gebreabzgi
- Selamawit Tibebu
- Dereje Hinsermu

## Challenge by

![10 Academy](https://static.wixstatic.com/media/081e5b_5553803fdeec4cbb817ed4e85e1899b2~mv2.png/v1/fill/w_246,h_106,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/10%20Academy%20FA-02%20-%20transparent%20background%20-%20cropped.png)
Empty file added airflow/dags/backtest_dag.py
Empty file.
Empty file added airflow/dags/monitor_dag.py
Empty file.
Empty file added app/__init__.py
Empty file.
Empty file added app/main.py
Empty file.
Empty file added app/models/backtest.py
Empty file.
Empty file added app/models/user.py
Empty file.
Empty file added app/routes/auth.py
Empty file.
Empty file added app/routes/backtest.py
Empty file.
Empty file added app/routes/index.py
Empty file.
Empty file.
Empty file added app/services/kafka_service.py
Empty file.
Empty file added app/services/mlflow_service.py
Empty file.
Empty file added app/templates/index.html
Empty file.
Empty file added config/airflow.cfg
Empty file.
Empty file added config/config.py
Empty file.
Empty file added config/kafka-config.yaml
Empty file.
Empty file added config/mlflow-config.yaml
Empty file.
Empty file added docker-compose.yml
Empty file.
Empty file added docs/DESIGN.md
Empty file.
Empty file added docs/USAGE.md
Empty file.
Empty file added notebooks/backtesting.ipynb
Empty file.
Empty file.
Empty file added notebooks/model_training.ipynb
Empty file.
Empty file added requirements.txt
Empty file.
Empty file added scripts/backtest_runner.py
Empty file.
Empty file added scripts/data_ingestion.py
Empty file.
Empty file added scripts/model_training.py
Empty file.
Empty file added setup.py
Empty file.
Empty file added tests/conftest.py
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.

0 comments on commit 7217127

Please sign in to comment.