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 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.2.tar.gz (82.0 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.2-py3-none-any.whl (118.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyutss-0.2.2.tar.gz
  • Upload date:
  • Size: 82.0 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.2.tar.gz
Algorithm Hash digest
SHA256 8b1354f4da7f5ff3d33ad200bb3dec0f6e5d613323801e48793868d01561e9b0
MD5 c619f68bc0e75e3521a73c3c540c7e75
BLAKE2b-256 1b9f722220eb7a73523ea9ce14f73f2031422cdf55b7e2f0e2eefe967c053220

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyutss-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 118.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 90768b967e9db1f8c5311a081b12120bde33bd2a037caa378e0f46a74bdabc4a
MD5 468a940a810b2c44b39f461b43cc5093
BLAKE2b-256 e9378c2428285dbb86ba2ca07ddae4b4c2711cf86cf55d39acc253eb849d4e9d

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