Skip to main content

QMT trading SDK with WebSocket (Centrifugo) integration

Project description

Stock Platform SDK

QMT trading SDK with WebSocket (Centrifugo) integration.

Installation

pip install stock-platform-sdk

QMT 环境指定安装路径:

pip install stock-platform-sdk -t E:\xt\bin.x64\Lib\site-packages

Usage

from stock_platform_sdk import configure, init

# Step 1: Configure connection
configure(
    access_key="your_access_key",
    secret_key="your_secret_key",
    strategy_name="my_strategy",
    backend_url="http://localhost:8888",      # optional
    centrifugo_url="http://localhost:8000"    # optional
)

# Step 2: Initialize in QMT strategy
def init(C):
    from stock_platform_sdk import init as sdk_init
    sdk_init(C)

API

  • configure(access_key, secret_key, strategy_name, ...) - Set connection parameters
  • init(C) - Initialize SDK with QMT ContextInfo
  • get_config() - Get current configuration
  • create_websocket_handler(access_key, secret_key, strategy_name) - Create WebSocket handler

Constants

from stock_platform_sdk import constants

constants.OrderStatus.FILLED          # 56
constants.TradeConfig.BUY_PRICE_MULTIPLIER  # 1.012
constants.ChannelPrefix.make_trade_channel("my_strategy")  # "trade:my_strategy"

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

stock_platform_sdk-0.1.1.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

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

stock_platform_sdk-0.1.1-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file stock_platform_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: stock_platform_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for stock_platform_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9c4a0eabc34c7dee5ad8b6f46ff58fd51a8171d4190a2fa20d0d9742efcaa88e
MD5 1c01fc814cc8a3010a6165b667d67a2a
BLAKE2b-256 779dc74a1729d3cd83c9378f39cef78e8c308f34e088d3c596518ebd4d4b3522

See more details on using hashes here.

File details

Details for the file stock_platform_sdk-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for stock_platform_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c3dfb5c0e5b98397311c6ae8023feabbe255f9f46ccaa6fc29704301724f944
MD5 066ecc92fe61e5739d18cffa9e72f16d
BLAKE2b-256 863b185ec099a19e2d30386a733b63dcde516b8b2753548f6711e04b04193477

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