tam
Config-driven event backtesting for stocks/indices: YAML in, an interactive
HTML dashboard out. Strategies (moving-average, MA crossover, trend rotation,
online-learning ML, local-LLM) are all pluggable — examples/backtest.py
doesn't import any strategy directly, it builds whatever's listed in the
config's strategies: section by name.
Published on PyPI as tam-quant (pip install tam-quant; import tam either
way). Running in Google Colab or Jupyter instead of this repo's own CLI? See
NOTEBOOK.md. Want to use individual pieces (data fetching,
rendering, live updates) outside the config-driven runner, or see every
component's API at a glance? See LIB.md.
Setup
Requires uv and Python 3.11 (pinned in
.python-version — uv will fetch it automatically if you don't have it).
uv sync --extra dev
This creates .venv/ and installs everything, including dev dependencies
(pytest). Run any command below with uv run ... so it uses that environment
— no need to activate the venv manually.
If you want to use the FMP data provider instead of the (no-key-needed)
yfinance default, copy .env.example to .env and fill in FMP_API_KEY.
Running the examples
Each example is a YAML config passed to the same runner:
uv run python -m examples.backtest examples/moving_average_config.yaml
uv run python -m examples.backtest examples/ma_crossover_config.yaml
uv run python -m examples.backtest examples/trend_rotation_config.yaml
These three work out of the box — no extra setup, no external services. Each
run prints a summary table (returns, Sharpe, drawdown, etc. per strategy)
with a live progress bar, and writes an interactive HTML dashboard to
examples/output/<name>_report.html — open that in a browser to see the
equity curves, drawdown, and per-trade markers (toggle with the "Show
Trades" button).
examples/llm_trading_config.yaml is different: it drives a strategy that
queries a local language model each simulated day, and by default also
periodically LoRA fine-tunes it (both via mlx-lm, M-series Mac only). The
first run downloads the base model from Hugging Face (needs network once).
Because it calls the model every simulated day, this one is much slower than
the others — try a short date range first (edit start/end in the config)
before running the full period. See the comments in that file for how to
point it at Ollama or another server instead, or turn LoRA fine-tuning off.
Want to try your own mix of strategies? Copy one of the configs and edit its
strategies: list — see tam/strategy/*.py for what's registered and what
params each one takes.
Running the tests
uv run pytest
No network access or external services required — everything is tested against fakes/mocks (fake data providers, a stubbed LLM client, etc.).
Metadata
Release files for tam-quant 0.1.79
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tam_quant-0.1.79.tar.gz | 347.2 kB | Without provenance | Details for tam_quant-0.1.79.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tam_quant-0.1.79-py3-none-any.whl | Python 3 | none | any | Details for tam_quant-0.1.79-py3-none-any.whl |
Total release size: 631.4 kB
Release files / tam_quant-0.1.79.tar.gz
| Download URL | tam_quant-0.1.79.tar.gz |
|---|---|
| Size | 347.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1067e6de604245b600bac1bbe84ff84ee1a4297dd3f91916c5375470ab1193de
|
|
BLAKE2b-256 checksum How to use checksums |
40757e76bcaff94df850c84d4a87804b7cfd4d33b87161461085abc3e5f10ac5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / tam_quant-0.1.79-py3-none-any.whl
| Download URL | tam_quant-0.1.79-py3-none-any.whl |
|---|---|
| Size | 284.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2938feabb19cdd6779d3a5a4cfe54f0a4c104de8144bbc2361ffbc7de863c1b6
|
|
BLAKE2b-256 checksum How to use checksums |
ecc8985dfe3b5bc51786a1417d25fc01b720c66a323b80e62672e784213f365b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for tam-quant 0.1.79
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.