Metadata-Version: 2.4
Name: pyutss
Version: 0.2.2
Summary: Python backtesting engine for Universal Trading Strategy Schema (UTSS)
Project-URL: Homepage, https://github.com/obichan117/utss
Project-URL: Documentation, https://obichan117.github.io/utss
Project-URL: Repository, https://github.com/obichan117/utss
Project-URL: Issues, https://github.com/obichan117/utss/issues
Author: obichan117
License: MIT
Keywords: algorithmic-trading,backtesting,quantitative-finance,trading,utss
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx>=0.25.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: pandas>=2.0.0
Requires-Dist: utss>=1.1.0
Provides-Extra: all
Requires-Dist: jinja2>=3.0.0; extra == 'all'
Requires-Dist: matplotlib>=3.7.0; extra == 'all'
Requires-Dist: mplfinance>=0.12.10b0; extra == 'all'
Requires-Dist: pyjquants>=0.2.0; extra == 'all'
Requires-Dist: scipy>=1.10.0; extra == 'all'
Requires-Dist: seaborn>=0.12.0; extra == 'all'
Requires-Dist: yfinance>=0.2.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: matplotlib>=3.7.0; extra == 'dev'
Requires-Dist: mypy>=1.8.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.3.0; extra == 'dev'
Requires-Dist: scipy>=1.10.0; extra == 'dev'
Requires-Dist: seaborn>=0.12.0; extra == 'dev'
Provides-Extra: jquants
Requires-Dist: pyjquants>=0.2.0; extra == 'jquants'
Provides-Extra: viz
Requires-Dist: jinja2>=3.0.0; extra == 'viz'
Requires-Dist: matplotlib>=3.7.0; extra == 'viz'
Requires-Dist: mplfinance>=0.12.10b0; extra == 'viz'
Requires-Dist: scipy>=1.10.0; extra == 'viz'
Requires-Dist: seaborn>=0.12.0; extra == 'viz'
Provides-Extra: yahoo
Requires-Dist: yfinance>=0.2.0; extra == 'yahoo'
Description-Content-Type: text/markdown

# pyutss - Python Backtesting Engine for UTSS

A backtesting engine that executes [UTSS](https://github.com/obichan117/utss) (Universal Trading Strategy Schema) strategies.

## Installation

```bash
# Core package
pip install pyutss

# With J-Quants support (Japanese stocks)
pip install pyutss[jquants]

# With Yahoo Finance support
pip install pyutss[yahoo]

# With all data providers
pip install pyutss[all]
```

## Quick Start

```python
from utss import validate_yaml
from pyutss import Engine
from pyutss.data import fetch

# Load strategy
strategy = validate_yaml(open("my_strategy.yaml").read())

# Fetch data and run backtest
data = fetch("AAPL", "2020-01-01", "2024-01-01")
engine = Engine(initial_capital=100_000)
result = engine.backtest(strategy, data=data, symbol="AAPL")

# View results
print(f"Return: {result.total_return_pct:.2f}%")
print(f"Trades: {result.total_trades}")
```

## Features

- **UTSS Native**: Directly executes UTSS strategy definitions
- **Multiple Data Sources**: J-Quants (Japan), Yahoo Finance (US/Global)
- **Comprehensive Metrics**: Sharpe, Sortino, max drawdown, win rate, and more
- **Indicator Support**: 50+ technical indicators matching UTSS schema

## Documentation

Full documentation: https://obichan117.github.io/utss

## License

MIT
