Skip to main content

Universal Trading Strategy Schema - A composable schema for expressing any trading strategy

Project description

UTSS - Universal Trading Strategy Schema

A comprehensive, composable schema for expressing any trading strategy.

Installation

pip install utss

Quick Start

from utss import validate_yaml, Strategy

# Load and validate a strategy from YAML
strategy = validate_yaml("""
info:
  id: rsi-reversal
  name: RSI Reversal Strategy
  version: "1.0"

universe:
  type: static
  symbols: ["AAPL", "GOOGL"]

rules:
  - name: buy-oversold
    when:
      type: comparison
      left:
        type: indicator
        indicator: RSI
        params:
          period: 14
      operator: "<"
      right:
        type: constant
        value: 30
    then:
      type: trade
      direction: buy
      sizing:
        type: percent_of_equity
        percent: 10
""")

print(f"Strategy: {strategy.info.name}")
print(f"Universe: {strategy.universe}")
print(f"Rules: {len(strategy.rules)}")

Features

  • LLM-friendly: Predictable structure, clear type discriminators
  • Composable: Signals → Conditions → Rules → Strategy
  • Extensible: Support for custom indicators, metrics, and events
  • Validated: Full Pydantic v2 validation

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

utss-1.0.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

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

utss-1.0.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file utss-1.0.0.tar.gz.

File metadata

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

File hashes

Hashes for utss-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6854e7a31a94251dbce38672e3f833a7c5e056901f39a15071a6ed2c98059697
MD5 ccf18561ddc77ed7f305bf6e40d718c0
BLAKE2b-256 53091f07ad846cc2c2d6eca2bbcd7186e8f69184733bab359a425a90602683a0

See more details on using hashes here.

File details

Details for the file utss-1.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for utss-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc21811706b534dd14959718e41903baa6f79deae3b85c565d9c7aa7a0d0ec70
MD5 196e9de700a2d27968d68068e5ce978e
BLAKE2b-256 6a41b95b1cfefd26bd8bc0e11c38d5c9cbda31bc4cdb67381fab9629bcd4bb00

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