天勤量化 Web UI 增强版 — 替换 tqsdk 默认 Web 界面,无需修改官方 SDK
Project description
tqwebhelper2
天勤量化 Web UI 增强版。通过 monkey-patch 替换 tqsdk 默认的 Web 界面,无需修改官方 SDK。
Preview
实盘
回测
安装
pip install tqwebhelper2
使用
import tqwebhelper2
tqwebhelper2.patch() # 必须在 TqApi 之前调用
from tqsdk import TqApi, TqAuth
api = TqApi(auth=TqAuth("user", "pass"), web_gui=True)
浏览器打开控制台输出的地址即可看到新版 Web 界面。
原理
- 继承原版
TqWebHelper,只替换_web_dir指向本包内的编译产物 - 通过
patch()同时替换tqsdk.tqwebhelper和tqsdk.api中的引用 - WebSocket 数据通道、路由逻辑完全复用原版,零侵入
unpatch()可恢复原版
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
tqwebhelper2-0.1.0.tar.gz
(86.1 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 tqwebhelper2-0.1.0.tar.gz.
File metadata
- Download URL: tqwebhelper2-0.1.0.tar.gz
- Upload date:
- Size: 86.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35825cded2cdb9640714977f8d7ff7fbbe27d2e7d61e2c84ec1e6b41153caf17
|
|
| MD5 |
b9b9d58a6c5df0cb629d7d42c57051a1
|
|
| BLAKE2b-256 |
aeadec77d38909996d2a5caa46934bad48ad1d6a46c58f99511d0f3b61198ec5
|
File details
Details for the file tqwebhelper2-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tqwebhelper2-0.1.0-py3-none-any.whl
- Upload date:
- Size: 86.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
242d124f07967ad8e2bc6115ae741aa0b7b8daf1a630e3a44dae108fa61df0c8
|
|
| MD5 |
8ca7157aa4c76ad065acf8d45ac8d6c3
|
|
| BLAKE2b-256 |
2397c288b8a886d2b6315ad2f41c1d23338c60d370cc1043bdd8363f9a50f267
|