Python backtesting engine for Universal Trading Strategy Schema (UTSS)
Project description
pyutss - Python Backtesting Engine for UTSS
A backtesting engine that executes UTSS (Universal Trading Strategy Schema) strategies.
Installation
# 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
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyutss-0.2.1.tar.gz
(81.9 kB
view details)
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
pyutss-0.2.1-py3-none-any.whl
(117.9 kB
view details)
File details
Details for the file pyutss-0.2.1.tar.gz.
File metadata
- Download URL: pyutss-0.2.1.tar.gz
- Upload date:
- Size: 81.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea8172d6eceec1bd73dda51426c4b7260de1098d92ff9ed422283272b8e85c59
|
|
| MD5 |
3bd685ddc09b5fdfcd8ec7b32c111757
|
|
| BLAKE2b-256 |
b6f97cbd5271cfe0cd3704775dfee30193cf76956ddec4066a174237d782932e
|
File details
Details for the file pyutss-0.2.1-py3-none-any.whl.
File metadata
- Download URL: pyutss-0.2.1-py3-none-any.whl
- Upload date:
- Size: 117.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a40cb4a7accd1bf846870feb86479e6ab1987e1d4446116d2b21961e39143b0a
|
|
| MD5 |
1f7922468c92d311edd40cfb9fd5dbfe
|
|
| BLAKE2b-256 |
b1f1d467a6ad236d916fce36a324f0d6e8934cee9aa9cb9c36db3d1be1a941d4
|