Skip to main content

Quantcentral.ai public Python SDK — strategy engine, indicators, stats, pairs, market calendars

Project description

quantcentral-sdk-python

PyPI version Python versions License: Apache-2.0

Quantcentral.ai public Python SDK — strategy engine, 30+ indicators, stats, pairs analysis, market calendars.

Part of the Quantcentral.ai ecosystem.

Status

v0.1.0 — initial extraction from the QuantStack monorepo. The public surface is stable for the listed modules; the cloud platform (orchestration, runners, AI agents, risk engine, marketplace) is not part of this package and remains proprietary.

Install

pip install quantcentral-sdk

Requires Python 3.12+.

Quickstart

from quantcentral import StrategyBase, indicators
from quantcentral.strategy import Param

class SmaCross(StrategyBase):
    fast = Param(10, type=int, min=2, max=200, label="Fast SMA")
    slow = Param(50, type=int, min=2, max=400, label="Slow SMA")

    def initialize(self):
        self.closes: list[float] = []

    def on_bar(self, bar):
        self.closes.append(bar.close)
        if len(self.closes) < self.slow:
            return

        fast_sma = indicators.sma(self.closes, self.fast)
        slow_sma = indicators.sma(self.closes, self.slow)

        if fast_sma > slow_sma and not self.get_position(bar.symbol).qty:
            self.buy(bar.symbol, qty=100)
        elif fast_sma < slow_sma:
            self.close_position(bar.symbol)

The strategy runs unchanged in any Quantcentral runner (local, cloud, replay). Hosting the runner / data feed is out of scope for this SDK — you provide bars, the strategy reacts.

Modules

Module Purpose
quantcentral.strategy StrategyBase lifecycle (initialize, on_bar, on_tick), Param / @input parameter descriptors.
quantcentral.indicators 30+ pure-Python indicators: sma, ema, rsi, macd, bollinger_bands, atr, adx, vwap, crossover, …
quantcentral.stats mean, stdev, correlation, linear_regression, rolling_mean, z_score, max_drawdown, …
quantcentral.pairs Cointegration helpers: compute_hedge_ratio, compute_zscore, half_life, is_cointegrated.
quantcentral.contracts msgspec / pydantic schemas for Bar, Quote, Order, Fill, Position, RunSpec, …
quantcentral.calendar Market calendars for NYSE, NASDAQ, TSX, LSE, JPX, ASX (via exchange_calendars) plus FOREX (24/5) and CRYPTO (24/7).

License

Apache-2.0 — see LICENSE for details. Attribution requirements in NOTICE.

Development

git clone git@github.com:QuantCentral-ai/quantcentral-sdk-python.git
cd quantcentral-sdk-python
python -m venv venv && source venv/bin/activate
pip install -e ".[dev]"
pytest

Tracking: https://github.com/QuantCentral-ai/quantcentral-planning

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

quantcentral_sdk-0.1.0.tar.gz (48.8 kB view details)

Uploaded Source

Built Distribution

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

quantcentral_sdk-0.1.0-py3-none-any.whl (37.0 kB view details)

Uploaded Python 3

File details

Details for the file quantcentral_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: quantcentral_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 48.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quantcentral_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3e574594093c9aba87fdeb9554bff54179763a9ff1c263b7956fe7910524003e
MD5 361973c394f942ffd43961d655aa7f05
BLAKE2b-256 573eeafc3633e9bb49a6fcf17ed5f09e26d1a6d9de639d88a9e7e16f0ef6a903

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantcentral_sdk-0.1.0.tar.gz:

Publisher: release.yml on QuantCentral-ai/quantcentral-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file quantcentral_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for quantcentral_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12504124e8b110f5d6a103416dc084ee1588933e2f1a48159212c3323b34939a
MD5 c5c3f5d3ba25c26f3d8d9e926e0e48a1
BLAKE2b-256 5d0242a45a778ebad50a61a265eba9f0d9a96c7b4c271c4a3b71e6ea32dd39ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for quantcentral_sdk-0.1.0-py3-none-any.whl:

Publisher: release.yml on QuantCentral-ai/quantcentral-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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