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
Release history Release notifications | RSS feed
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.1.0.tar.gz
(15.5 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
utss-1.1.0-py3-none-any.whl
(17.5 kB
view details)
File details
Details for the file utss-1.1.0.tar.gz.
File metadata
- Download URL: utss-1.1.0.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf528d73884a619bc15f18c94cd0da31151302116fbef37e889ad44398a57bd4
|
|
| MD5 |
8516c692f573e1966689c3895d28a496
|
|
| BLAKE2b-256 |
ef9966850e6bf0559c83e09ca447cbcc90245c0c5a6b60715d6c760c1b70a1b5
|
File details
Details for the file utss-1.1.0-py3-none-any.whl.
File metadata
- Download URL: utss-1.1.0-py3-none-any.whl
- Upload date:
- Size: 17.5 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 |
39663a0d92fc87bb5e49ab1553a632a8ce2100568f9e77eb37955a76a452d379
|
|
| MD5 |
50732a1edd0d1a5a150f5a5b9525fb00
|
|
| BLAKE2b-256 |
1f75067d837bdf1dbf7f704a09893c7cf4cfd8787eccb1e2193508035e8e23ce
|