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 parametersinit(C)- Initialize SDK with QMT ContextInfoget_config()- Get current configurationcreate_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
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
stock_platform_sdk-0.1.3.tar.gz
(21.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
File details
Details for the file stock_platform_sdk-0.1.3.tar.gz.
File metadata
- Download URL: stock_platform_sdk-0.1.3.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66eca556d66b01ea3310c4455ec38037f146b9c9e7258542e6ed90d837d9bbec
|
|
| MD5 |
508c610be20bf73b2e02dd9abb1f06b6
|
|
| BLAKE2b-256 |
2c5d4ce55bbc1bd7d561e9134e95a9de50b9e424e3053f25efa0aabe274ace58
|
File details
Details for the file stock_platform_sdk-0.1.3-py3-none-any.whl.
File metadata
- Download URL: stock_platform_sdk-0.1.3-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27460ff662d610cfe9437704af956944c31551bde052dab871e48fca85a9fb63
|
|
| MD5 |
02f732e7766070db9b207ab3a5428044
|
|
| BLAKE2b-256 |
6bfab00a8e3d84b1e45e96389d8f0bf5f32d6cfe0750fcc7a7e8c9e02f924a37
|