Unified quant-finance toolkit: market data, metrics, charts, Monte Carlo, backtesting, ML, macro, options, mortgage, Alpaca.
Project description
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?
yfinanceneeds 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file algorithm_stat-0.1.2.tar.gz.
File metadata
- Download URL: algorithm_stat-0.1.2.tar.gz
- Upload date:
- Size: 64.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47daa4f85e88926122b66f31c33f0f84da19fdbac614e3ac5b77cfdcf4588df9
|
|
| MD5 |
308536b4366a5e9dd358f312497c1ae0
|
|
| BLAKE2b-256 |
c586f15c3a19719bccffc261f1d78f3aaddaf0bf8be67e69fed5cea43aa3898c
|
File details
Details for the file algorithm_stat-0.1.2-py3-none-any.whl.
File metadata
- Download URL: algorithm_stat-0.1.2-py3-none-any.whl
- Upload date:
- Size: 86.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d5701618447bf667e7a495234ecbc463eb43793f0a5fc58f79e001bd34bbbab
|
|
| MD5 |
eb31eceefe987c071458b7f991af3c4c
|
|
| BLAKE2b-256 |
946a577ce0a85b2a2ca565cf4c02d5c42c9e8de9a48b909db3fd197793487c74
|