Skip to main content

TradePose Models

Shared Pydantic contracts, enums, indicator calculations, and Polars schemas for TradePose packages.

Installation

pip install tradepose-models

Python 3.13 or newer is required.

Indicator specification

Indicator is the public calculation factory. IndicatorSpec adds canonical source provenance and resolved wire identity.

from tradepose_models.enums import Freq
from tradepose_models.indicators import Indicator
from tradepose_models.strategy import IndicatorSpec, SourceDescriptor

source = SourceDescriptor(instrument="NAS100", freq=Freq.DAY_1)
atr_spec = IndicatorSpec(
    source=source,
    shift=1,
    indicator=Indicator.atr(period=14, shift=1).config,
)

assert atr_spec.instrument == "NAS100"
assert atr_spec.indicator_id.startswith("sha256:")
assert atr_spec.column_id.startswith("ind_v1_")
assert atr_spec.public_name.startswith("NAS100@1D:ATR(period=14)")
assert atr_spec.output_ref().indicator_id == atr_spec.indicator_id

public_name is presentation metadata for logs and friendly artifact views. column_id is the only physical DataFrame column name; col() selects that struct column and callers then select a declared field such as .struct.field("value"). short_name and display_name() are not part of the indicator API.

Typed authoring dependencies

Authoring dependencies use IndicatorRef; resolved IndicatorOutputRef values belong only to compiled IndicatorSpec wire data. Do not substitute readable labels or physical ind_v1_* column identities for typed references.

from tradepose_models.indicators import Indicator
from tradepose_models.strategy import IndicatorRef

atr = Indicator.atr(period=14, shift=1)
atr_quantile = Indicator.atr_quantile(
    IndicatorRef(name="atr"),
    window=252,
    quantile=0.5,
    shift=0,
)
supertrend = Indicator.supertrend(
    3.0,
    IndicatorRef(name="atr"),
    shift=1,
)

For open-driven decisions, indicators reading high, low, close, or volume require shift >= 1. A literal current-bar column="open" may use shift=0.

Core modules

  • tradepose_models.strategy: strategy, graph, authoring, manifest, and portfolio data contracts.
  • tradepose_models.indicators: calculation models and the Indicator factory.
  • tradepose_models.enums: shared frequencies and trading enums.
  • tradepose_models.schemas: trades and timezone-aware OHLCV schemas.
  • tradepose_models.export: typed export request and response contracts.

Experiment catalogs, workspace lifecycle, execution, and portfolio promotion are owned by tradepose-client; Models does not provide a Python strategy registry.

Development

From the repository python/ directory:

uv run --project packages/models pytest packages/models/tests
uv run ruff check packages/models

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tradepose_models-2.7.0.tar.gz (149.9 kB view details)

Uploaded Source

Built Distribution

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

tradepose_models-2.7.0-py3-none-any.whl (160.9 kB view details)

Uploaded Python 3

File details

Details for the file tradepose_models-2.7.0.tar.gz.

File metadata

  • Download URL: tradepose_models-2.7.0.tar.gz
  • Upload date:
  • Size: 149.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for tradepose_models-2.7.0.tar.gz
Algorithm Hash digest
SHA256 2b5ecf9a3d5a42e75928b6d764fc997ee418dca652f38dc336bc7e70c9adc472
MD5 ed318ba2f5080772de575cc51658f39f
BLAKE2b-256 69cf6ad7373d33ae9489b7ba1558f915215b53866c0f3eeea7212deb0d273c9d

See more details on using hashes here.

File details

Details for the file tradepose_models-2.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tradepose_models-2.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7290e259584cb9a5744116339c11c8753ffdd9401a97ccf8a3d148cc9a66a88
MD5 f8cd75d7db32d616937ef73a29cc32d6
BLAKE2b-256 2e18622687cd914967a470ba29600d68aeca80afaac1986d15d4349c482e9b3e

See more details on using hashes here.

Release history Release notifications | RSS feed

2.15.0

2 files

2.14.0

2 files

2.13.0

2 files

2.12.0

2 files

2.11.1

2 files

2.11.0

2 files

2.10.0

2 files

2.9.1

2 files

2.9.0

2 files

2.8.0

2 files

2.7.3

2 files

2.7.2

2 files

2.7.1

2 files

This release

2.7.0 This release

2 files

2.6.0

2 files

2.5.0

2 files

2.4.1

2 files

2.4.0

2 files

2.3.0

2 files

2.2.0

2 files

2.1.0

2 files

2.0.0

2 files

1.7.0

2 files

1.6.1

2 files

1.6.0

2 files

1.5.0

2 files

1.4.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page