Skip to main content

PyPI

crypto_empyrical

crypto_empyrical is a fork of Quantopian's Empyrical package modified by Jesse to work for 24/7 markets of cryptocurrency.

Table of Contents

Installation

pip install crypto_empyrical

Usage

Simple Statistics

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

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

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

Metadata

Release files for crypto-empyrical 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for crypto-empyrical 1.0.4
File Size Uploaded Provenance Actions
crypto_empyrical-1.0.4.tar.gz 58.7 kB Without provenance Details for crypto_empyrical-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for crypto-empyrical 1.0.4
File Interpreter ABI Platform Actions
crypto_empyrical-1.0.4-py3-none-any.whl Python 3 none any Details for crypto_empyrical-1.0.4-py3-none-any.whl

Total release size: 103.6 kB

Release files / crypto_empyrical-1.0.4.tar.gz

Download URL crypto_empyrical-1.0.4.tar.gz
Size 58.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4dd434258614140e51e0ef4e5d021c06c406af65e85ba8c6d35857a7cbc1f636
BLAKE2b-256 checksum
How to use checksums
71b0d5c354775c091f6602d367d61ad9321f5bc28837e7eb58abb0bd6ee8560c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

Release files / crypto_empyrical-1.0.4-py3-none-any.whl

Download URL crypto_empyrical-1.0.4-py3-none-any.whl
Size 44.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65903cf14501d638c7efe10ff76c363468a1481af3201ed7dac2d23906c5cddf
BLAKE2b-256 checksum
How to use checksums
dc54eb13e24a289f41ea445390ece8bdd3879521ad555222d7e256d0486fa49c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

Security for crypto-empyrical 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page