Skip to main content

algo-stat

Quant analysis in 3 lines. A self-contained Python toolkit for market data, metrics, charts, Monte Carlo, backtesting, ML, macro, options, mortgage, and Alpaca paper trading.

algo-stat = library  +  CLI  +  REST API  +  Streamlit dashboard

Install (local laptop)

cd algo-stat
python -m venv .venv && source .venv/bin/activate
pip install -e ".[all,test,dev]"        # all = trading + ml-deep
cp .env.example .env                    # add FRED_API_KEY (free, optional)

API keys? yfinance needs none. FRED needs a free key (signup: https://fred.stlouisfed.org/docs/api/api_key.html). Alpaca only if you want paper trading.

3-line analyses (Jupyter / Python REPL)

import algo_stat as a; a.use_dark()
a.report(a.fetch("NVDA", period="1y"), ticker="NVDA")
import algo_stat as a
a.compare(["AAPL","MSFT","NVDA","GOOGL"], period="2y").show()
import algo_stat as a
a.MonteCarlo("NVDA").simulate(n=1000, days=252).plot()
import algo_stat as a
bt = a.Backtester("NVDA", period="2y").run(a.SMACrossover(20, 50))
print(bt.stats); bt.plot()

More examples in notebooks/quickstart.py.

CLI

algo-stat quote NVDA
algo-stat analyze NVDA --period 1y --chart
algo-stat compare AAPL,MSFT,NVDA,GOOGL --period 2y --chart
algo-stat montecarlo NVDA --n 1000 --days 252 --chart
algo-stat backtest NVDA --fast 20 --slow 50 --chart
algo-stat mortgage 300000 60000 0.055 --years 25
algo-stat macro cpi --years 10
algo-stat serve            # FastAPI on :8000
algo-stat dashboard        # Streamlit on :8501

REST API

algo-stat serve
# → open http://127.0.0.1:8000/docs   (Swagger UI)

Endpoints:

Method Path Purpose
GET /health health check
GET /quote/{ticker} fundamental snapshot
GET /prices/{ticker} OHLCV tail
GET /performance/{ticker} CAGR / Sharpe / VaR / MDD
GET /compare?tickers=... normalized growth
POST /montecarlo GBM simulation summary
POST /backtest/sma SMA crossover stats
POST /mortgage mortgage summary
GET /macro/{series} FRED series
POST /options/black-scholes option pricing

Streamlit dashboard

algo-stat dashboard

7 tabs: Performance · Compare · Monte Carlo · Backtest · Mortgage · Macro · Options.

Package layout

algo_stat/
  data/         market.py · macro.py · universe.py
  metrics/      returns.py · performance.py · risk.py
  charts/       theme.py · price.py · compare.py · correlation.py · fundamentals.py
  derivatives/  montecarlo.py · options.py
  backtest/     engine.py · strategies.py
  ml/           pca.py · regression.py · classifier.py
  property/     mortgage.py
  trading/      alpaca_client.py
  cli.py        api.py        dashboard.py     report.py     config.py

Tests

pytest -q

Credits

© 2026 Squid Consultancy Group Ltd — Elastic License 2.0.

Metadata

Release files for algorithm-stat 0.1.2

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

Source distribution (sdist)

Source distribution for algorithm-stat 0.1.2
File Size Uploaded
algorithm_stat-0.1.2.tar.gz 64.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for algorithm-stat 0.1.2
File Interpreter ABI Platform
algorithm_stat-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 150.7 kB

Release files / algorithm_stat-0.1.2.tar.gz

Download URL algorithm_stat-0.1.2.tar.gz
Size 64.6 kB
Tags Source
SHA-256 checksum
How to use checksums
47daa4f85e88926122b66f31c33f0f84da19fdbac614e3ac5b77cfdcf4588df9
BLAKE2b-256 checksum
How to use checksums
c586f15c3a19719bccffc261f1d78f3aaddaf0bf8be67e69fed5cea43aa3898c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / algorithm_stat-0.1.2-py3-none-any.whl

Download URL algorithm_stat-0.1.2-py3-none-any.whl
Size 86.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d5701618447bf667e7a495234ecbc463eb43793f0a5fc58f79e001bd34bbbab
BLAKE2b-256 checksum
How to use checksums
946a577ce0a85b2a2ca565cf4c02d5c42c9e8de9a48b909db3fd197793487c74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

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