---
title: "Lab"
description: "Python For Trading lab: reading path through every report, QUANTARMY libraries and repositories, and a matplotlib chart style."
url: "https://pythonparatrading.com/en/lab/"
lang: "en"
image: "https://pythonparatrading.com/og/en/lab.png"
---

# Lab

> Python For Trading lab: reading path through every report, QUANTARMY libraries and repositories, and a matplotlib chart style.

Reading path, systems and tools. What sits behind the reports.

## Recommended reading order

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.

### Theoretical foundations

Volatility, liquidity, stochastic processes and monetary policy. The starting point for understanding markets from a quantitative perspective.

1. [Introduction to Volatility - Liquidity](https://pythonparatrading.com/en/introduction-to-volatility-liquidity/)
2. [Volatility Estimators for Trading](https://pythonparatrading.com/en/volatility-estimators-for-trading/)
3. [Uses of Volatility and Current Volatility - VIX1D](https://pythonparatrading.com/en/uses-of-volatility/)
4. [Volatility Targeting in Python](https://pythonparatrading.com/en/volatility-targeting-2/)
5. [Stochastic Processes - Random Walks](https://pythonparatrading.com/en/stochastic-processes/)
6. [Price Discovery & Arbitrage Pricing Theory](https://pythonparatrading.com/en/arbitrage-pricing-theory-and-price-discovery-2/)
7. [Limit Order Book - Aggregated Market Liquidity](https://pythonparatrading.com/en/limit-order-book-and-market-liquidity/)
8. [Quantitative Models and Algorithmic Execution](https://pythonparatrading.com/en/quantitative-models-algorithmic-execution/)
9. [Central Banks and Monetary Policy in Python](https://pythonparatrading.com/en/monetary-policy-in-python/)

### Backtesting with Zipline

Strategy backtesting with Zipline, the most emblematic Python engine for algorithmic trading, and the first analyses on a data bundle.

1. [Zipline in Python - Part 1: Quant Stack and Pipeline](https://pythonparatrading.com/en/zipline-backtesting-with-python-quant-stack/)
2. [Zipline, Backtesting in Python 2: My First Data Analysis](https://pythonparatrading.com/en/backtesting-python-zipline-bundle-2/)
3. [Alpha Factors and Alpha Trading in Python](https://pythonparatrading.com/en/alpha-factors-and-alpha-trading-in-python/)

### Big data with ArcticDB

Big data management for trading with ArcticDB: from the introduction to a Nasdaq datalake integrated with Zipline.

1. [Big Data Management. 1 - Introduction to Big Data for Trading with ArcticDB](https://pythonparatrading.com/en/big-data-for-trading/)
2. [Big Data Management. 2 - First Lines of Code](https://pythonparatrading.com/en/big-data-for-trading-with-arcticdb/)
3. [Big Data Management 3 - Building a Datalake on the Nasdaq with ArcticDB.](https://pythonparatrading.com/en/big-data-with-arcticdb/)
4. [Big Data Management 4 - Using the Datalake in Zipline](https://pythonparatrading.com/en/backtesting-with-zipline-and-arcticdb/)

### Tools and practice

Docker, OpenBB, seasonality, quant research and reporting. What the quantitative trader needs day to day.

1. [The Working Environment - 1](https://pythonparatrading.com/en/docker-for-trading/)
2. [Python for Trading Course - Part 1: Market Data with OpenBB](https://pythonparatrading.com/en/openbb-free-market-data/)
3. [Approximately Calculating USD Liquidity](https://pythonparatrading.com/en/usd-liquidity/)
4. [Advanced Financial Report Library in Python](https://pythonparatrading.com/en/advanced-reporting-2/)
5. [Impact of Seasonal Factor on US Bonds](https://pythonparatrading.com/en/seasonality-usa-yields/)
6. [Your first system in Python: moving-average crossover on SPY](https://pythonparatrading.com/en/first-system-moving-average-crossover/)
7. [Introduction to Quant Research](https://pythonparatrading.com/en/quant-research-2/)
8. [Seasonality in Python. Searching for Intraday Patterns](https://pythonparatrading.com/en/seasonality-intraday-preprocessing/)
9. [Seasonality in Python II - Backtesting](https://pythonparatrading.com/en/seasonality-intraday-backtesting/)
10. [Seasonality in Python III - Statistics on Trading](https://pythonparatrading.com/en/seasonality-intraday-statistics/)
11. [Intraday Seasonality IV - Field Search](https://pythonparatrading.com/en/seasonality-intraday-optimization/)
12. [QAStats V3 Released](https://pythonparatrading.com/en/qastats-v3-released-2/)

[See paths](https://pythonparatrading.com/en/paths/)

## Libraries and repositories

QUANTARMY public code on GitHub: what the reports use, packaged for reuse.

### QAStats

Pandas-based reporting library for portfolios and strategies: performance and risk metrics, drawdowns and factsheets. Built on empyrical and pyfolio.

Library · Python · v3.0.1 · 2 stars
- [View project](https://pythonparatrading.com/en/lab/qastats/)
- Code on GitHub: https://github.com/quantarmyz/QAStats
- Report: [QAStats V3 Released](https://pythonparatrading.com/en/qastats-v3-released-2/)

### Datalake

NoSQL S3 datalake on ArcticDB: ingestion from several market data sources, Alpha Vantage included, and a management CLI.

Library · Python · v5.1 · 1 star
- [View project](https://pythonparatrading.com/en/lab/datalake/)
- Code on GitHub: https://github.com/quantarmyz/datalake
- Report: [Big Data Management 3 - Building a Datalake on the Nasdaq with ArcticDB.](https://pythonparatrading.com/en/big-data-with-arcticdb/)

### Quantstack

Research and backtesting environment in one container: Docker, Debian, conda, JupyterLab, zipline-reloaded and ArcticDB.

Repository · Jupyter Notebook · 7 stars
- [View project](https://pythonparatrading.com/en/lab/quantstack/)
- Code on GitHub: https://github.com/quantarmyz/quantstack
- Report: [Zipline in Python - Part 1: Quant Stack and Pipeline](https://pythonparatrading.com/en/zipline-backtesting-with-python-quant-stack/)

### Nowcasting

Estimating the present from high-frequency data before the official figures are published. Coming soon to the lab.

Coming soon · Python

## Chart style

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.

[Download ppt-dark.mplstyle](https://pythonparatrading.com/ppt-dark.mplstyle)

```python
import 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")
```
