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.2.tar.gz (21.6 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.2-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stock_platform_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 21.6 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.2.tar.gz
Algorithm Hash digest
SHA256 e0e1754b812bb6c16a369dc174d399f59a8de46e737954190d638ca481058022
MD5 0c063a80b76d1c4604240c4863184608
BLAKE2b-256 e8e57e7f002653a0011dd9a3907c6c035ec8888718037e886d7d3e87b194234e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stock_platform_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 44c32ebdb2b830e4b4eea2a498b7102912eb681072bcf9996cf421da2145bbbc
MD5 576f2c7194bc072891ddbfdd09ff93b4
BLAKE2b-256 06519c46f61c944bad37ba483e982282d0ec53ddac4613c64fe9b2df88540c71

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