Skip to main content

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 BacktestEngine
from pyutss.data import YahooProvider

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

# Setup data provider
provider = YahooProvider()

# Run backtest
engine = BacktestEngine(provider, initial_capital=100_000)
result = engine.run(strategy, start="2020-01-01", end="2024-01-01")

# View results
print(result.metrics.sharpe_ratio)
print(result.metrics.max_drawdown)
result.plot()

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.1.0.tar.gz (65.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyutss-0.1.0-py3-none-any.whl (85.7 kB view details)

Uploaded Python 3

File details

Details for the file pyutss-0.1.0.tar.gz.

File metadata

  • Download URL: pyutss-0.1.0.tar.gz
  • Upload date:
  • Size: 65.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for pyutss-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8703bb3b0445789998f7e8b238a897a5fe63c236da3d8ce64bb396486c82d524
MD5 e645f67046e7d5318a2651d5c742d034
BLAKE2b-256 47b2f23b2e68d8e2511f9165645d1485f3ebc69005492665cfb0eb2fb36bc874

See more details on using hashes here.

File details

Details for the file pyutss-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyutss-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 85.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for pyutss-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16386fc9567b098bf58faf9bdb507ebbb18651b77dd8cd18c30f15186f986a5c
MD5 2da8b4ae27d27b01b3a7095fb3ab632d
BLAKE2b-256 b944d6626e6f1ad055979bb2a09054477cee8b28686fb46ffe34d148cb92e0f1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page