QAStats
Pandas-based reporting library for portfolios and strategies: performance and risk metrics, drawdowns and factsheets. Built on empyrical and pyfolio.
v3.0.1 · 2 stars
Lab
Reading path, systems and tools. What sits behind the reports.
[ 01 ]Reading path
Welcome to the Python for Trading resources page. Here you will find all published articles, organized by category and in the recommended reading order. Each category covers a fundamental area of quantitative trading with Python.
We start with theoretical foundations: volatility, liquidity, stochastic processes and monetary policy. Then we move to backtesting with Zipline, followed by big data management with ArcticDB, and we close with tools and practices for the day-to-day work.
All articles include Python code, SVG diagrams, mathematical formulas and practical examples. This list is constantly updated as new articles are published.
CAT-019 reports
Volatility, liquidity, stochastic processes and monetary policy. The starting point for understanding markets from a quantitative perspective.
CAT-023 reports
Strategy backtesting with Zipline, the most emblematic Python engine for algorithmic trading, and the first analyses on a data bundle.
CAT-034 reports
Big data management for trading with ArcticDB: from the introduction to a Nasdaq datalake integrated with Zipline.
CAT-0412 reports
Docker, OpenBB, seasonality, quant research and reporting. What the quantitative trader needs day to day.
[ 02 ]Systems
QUANTARMY public code on GitHub: what the reports use, packaged for reuse.
Pandas-based reporting library for portfolios and strategies: performance and risk metrics, drawdowns and factsheets. Built on empyrical and pyfolio.
v3.0.1 · 2 stars
NoSQL S3 datalake on ArcticDB: ingestion from several market data sources, Alpha Vantage included, and a management CLI.
v5.1 · 1 star
Research and backtesting environment in one container: Docker, Debian, conda, JupyterLab, zipline-reloaded and ArcticDB.
7 stars
Previous version of QAStats, with an example notebook that builds pandas-style factsheets from empyrical calculations.
v2.0.1 · 2 stars
[ 03 ]Resources
ppt-dark.mplstyle applies the site tokens to matplotlib: black background, grey axes and grid, light grey text and series in bone, blue, orange and amber. It is the style of the report figures.
ppt-dark.mplstyle · Matplotlib · Plain text
Download ppt-dark.mplstyleimport matplotlib.pyplot as plt
import numpy as np
# Site style: from the published URL or from a local copy of the file
plt.style.use("https://pythonparatrading.com/ppt-dark.mplstyle")
rets = np.random.default_rng(7).normal(0.0004, 0.01, size=(252, 4))
equity = (1 + rets).cumprod(axis=0)
fig, ax = plt.subplots()
ax.plot(equity)
ax.set_title("Equity curves")
fig.savefig("equity.png")