Metadata-Version: 2.1
Name: crypto-strategy
Version: 0.1.6
Summary: Repo to create crypto strategies
Home-page: https://github.com/minggnim/crypto-strategy
Author: Ming Gao
Author-email: ming_gao@outlook.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Provides-Extra: full
License-File: LICENSE

# crypto-strategy
A repository to perform backtests and create trading strategies for cryptocurrencies.

[![Python package](https://github.com/minggnim/crypto-strategy/actions/workflows/python-package.yml/badge.svg)](https://github.com/minggnim/crypto-strategy/actions/workflows/python-package.yml)
[![pypi-upload](https://github.com/minggnim/crypto-strategy/actions/workflows/python-publish.yml/badge.svg)](https://github.com/minggnim/crypto-strategy/actions/workflows/python-publish.yml)
[![pages-build-deployment](https://github.com/minggnim/crypto-strategy/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/minggnim/crypto-strategy/actions/workflows/pages/pages-build-deployment)

![](./img/algo-trading.png)


## Install
```
pip install crypto-strategy[full]
```

## Usage
1. Moving average strategy
```
BestMaStrategy(symbols, freq, res_dir, flag_filter)
```
- symbols: asset name, e.g., BTCUSDT
- freq: data frequency to use, 1h | 4h
- res_dir: results directory
- flag_filter: filter to use, [mmi | ang]
    - mmi: Market Meanness Index filter
    - ang: Linear Regression Angle filter

2. Breakout strategy
```
BestBoStrategy(symbols, freq, res_dir, flag_filter, flag_ts_stop)
```
- symbols: asset name, e.g., BTCUSDT
- freq: data frequency to use, 1h | 4h
- res_dir: results directory
- flag_filter: filter to use, [mmi | ang]
    - mmi: Market Meanness Index filter
    - ang: Linear Regression Angle filter
- flag_ts_stop: trailing stop filter

3. macd strategy
```
BestMacdStrategy(symbols, freq, res_dir, flag_filter)
```
- symbols: asset name, e.g., BTCUSDT
- freq: data frequency to use, 1h | 4h
- res_dir: results directory
- flag_filter: filter to use, [mmi | ang | stoch | sma]
    - vol: Volume filter
    - ang: Linear Regression Angle filter

## CLI

Backtests can also be carried out in command line. To find out more

```
crypto --help
```

## Tests
pytest

