Metadata-Version: 2.4
Name: pyquaver
Version: 0.1.3
Summary: Standalone PyPI library for quantitative trading signal generation and backtesting
Project-URL: Homepage, https://github.com/maczg/quaver
Project-URL: Repository, https://github.com/maczg/quaver
Project-URL: Issues, https://github.com/maczg/quaver/issues
Author-email: Massimo Gollo <dev@massimogollo.cloud>
Maintainer-email: Massimo Gollo <dev@massimogollo.cloud>
License-Expression: MIT
License-File: LICENSE
Keywords: algorithmic trading,backtesting,finance,quantitative trading,signal generation
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: matplotlib>=3.10.8
Requires-Dist: numpy>=2.4.2
Requires-Dist: pandas>=3.0.1
Requires-Dist: yfinance>=1.2.0
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pandas-stubs; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Provides-Extra: docs
Requires-Dist: myst-parser>=4.0; extra == 'docs'
Requires-Dist: sphinx-autodoc-typehints>=3.9.7; extra == 'docs'
Requires-Dist: sphinx-rtd-theme>=3.1.0; extra == 'docs'
Requires-Dist: sphinx>=9.1.0; extra == 'docs'
Provides-Extra: notebooks
Requires-Dist: jupyter>=1.0; extra == 'notebooks'
Requires-Dist: matplotlib>=3.8; extra == 'notebooks'
Requires-Dist: yfinance>=0.2; extra == 'notebooks'
Description-Content-Type: text/markdown

# quaver

Standalone Python library for quantitative trading signal generation and walk-forward backtesting.

## Installation

```bash
pip install pyquaver
```

With optional extras:

```bash
# Interactive notebooks with yfinance data
pip install pyquaver[notebooks]

# Development tools (pytest, ruff, mypy)
pip install pyquaver[dev]

# Sphinx documentation
pip install pyquaver[docs]
```

## Quick Start

### Single-asset backtest

```python
import pandas as pd
from quaver.backtest import run_backtest

# Load your OHLCV data (must have columns: ts, open, high, low, close, volume)
candles = pd.read_csv("data.csv")

result = run_backtest(
    engine_name="mean_reversion",
    parameters={"fast_period": 20, "slow_period": 50, "threshold": 0.02},
    candles=candles,
    instrument_id="AAPL",
    initial_capital=10_000.0,
)

print(result.summary())
```

### Multi-asset pairs backtest

```python
from quaver.backtest import run_multi_asset_backtest

results = run_multi_asset_backtest(
    engine_name="pairs_mean_reversion",
    parameters={
        "instrument_a": "AAPL",
        "instrument_b": "MSFT",
        "spread_window": 60,
        "entry_z": 2.0,
        "exit_z": 0.5,
    },
    candles_map={"AAPL": candles_aapl, "MSFT": candles_msft},
    initial_capital=10_000.0,
    allow_shorting=True,
)

for iid, r in results.items():
    print(f"{iid}: {r.summary()}")
```

### Discover strategies

```python
from quaver.strategies.registry import StrategyRegistry
import quaver.strategies  # auto-registers all built-in engines

print(StrategyRegistry.list_engines())
# ['mean_reversion', 'pairs_mean_reversion', 'regime_mean_reversion', 'vsa_stopping_volume']
```

## Built-in Strategies

| Strategy | Type | Description |
|---|---|---|
| `mean_reversion` | single | Dual moving-average mean reversion |
| `regime_mean_reversion` | single | Regime-based probabilistic mean reversion |
| `vsa_stopping_volume` | single | VSA stopping-volume reversal pattern |
| `pairs_mean_reversion` | multi | Statistical arbitrage pairs trading |

## Requirements

- Python >= 3.12
- numpy >= 2.4.2
- pandas >= 3.0.1

## License

MIT
