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.2.0.tar.gz (83.6 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.2.0-py3-none-any.whl (106.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyutss-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1d70e338702c8ee6d804b852755cb52f9a1e436a72b487bcd5791cf7944f09a3
MD5 a06be3c3a20920a7cce6153efa8e438e
BLAKE2b-256 d47c030c3ff2eb2c0914e4a1f15931d9866acc6b9161797371ba9a836be60406

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyutss-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 106.3 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 017c219267f12d6e3995236c869187d14bf21a29c94760f131a265fe37efbc20
MD5 50a957afeb2ce7d9f1ce00ca46fae2fa
BLAKE2b-256 01913ddfb657c0283021298bcb4733bd395405690266253f09f1ee0222c84a86

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