crypto-empyrical-1.0.4
توضیحات
crypto_empyrical is a fork of Quantopian's Empyrical package modified to work for 24/7 markets of cryptocurrency
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | crypto-empyrical-1.0.4 |
| نام | crypto-empyrical |
| نسخه کتابخانه | 1.0.4 |
| نگهدارنده | ['Jesse.Trade'] |
| ایمیل نگهدارنده | ['info@jesse.trade'] |
| نویسنده | - |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | https://github.com/jesse-ai/crypto-empyrical |
| آدرس اینترنتی | https://pypi.org/project/crypto-empyrical/ |
| مجوز | Apache License, Version 2.0 |
[](https://pypi.org/project/crypto_empyrical/)
# crypto_empyrical
crypto_empyrical is a fork of Quantopian's Empyrical package modified by [Jesse](https://jesse.trade) to work for 24/7 markets of cryptocurrency.
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Support](#support)
- [Contributing](#contributing)
- [Testing](#testing)
## Installation
```
pip install crypto_empyrical
```
## Usage
Simple Statistics
```python
import numpy as np
from crypto_empyrical import max_drawdown, alpha_beta
returns = np.array([.01, .02, .03, -.4, -.06, -.02])
benchmark_returns = np.array([.02, .02, .03, -.35, -.05, -.01])
# calculate the max drawdown
max_drawdown(returns)
# calculate alpha and beta
alpha, beta = alpha_beta(returns, benchmark_returns)
```
Rolling Measures
```python
import numpy as np
from crypto_empyrical import roll_max_drawdown
returns = np.array([.01, .02, .03, -.4, -.06, -.02])
# calculate the rolling max drawdown
roll_max_drawdown(returns, window=3)
```
Pandas Support
```python
import pandas as pd
from crypto_empyrical import roll_up_capture, capture
returns = pd.Series([.01, .02, .03, -.4, -.06, -.02])
# calculate a capture ratio
capture(returns)
# calculate capture for up markets on a rolling 60 day basis
roll_up_capture(returns, window=60)
```
## Testing
- install requirements
- "nose>=1.3.7",
- "parameterized>=0.6.1"
```
./runtests.py
```
نیازمندی
| مقدار | نام |
|---|---|
| - | numpy |
| - | pandas |
| - | scipy |
| - | six |
| - | pandas-datareader |
| ==1.3.7 | nose |
| ==0.6.1 | parameterized |
| ==2.5.1 | flake8 |
نحوه نصب
نصب پکیج whl crypto-empyrical-1.0.4:
pip install crypto-empyrical-1.0.4.whl
نصب پکیج tar.gz crypto-empyrical-1.0.4:
pip install crypto-empyrical-1.0.4.tar.gz