VnPy TQSdk EDB Datafeed
VnPy 的天勤 EDB 免费行情数据适配器。
功能特性
- 支持从天勤 EDB 服务获取历史 K 线数据
- 免费模式支持:
- 日线数据:任意历史区间
- 分钟线数据:最近 1 年
- 支持多种时间周期:1分钟、日线
安装
安装环境推荐基于3.0.0版本以上的【VeighNa Studio】。
直接使用pip命令:
pip install vnpy_tqsdk_edb
或者下载源代码后,解压后在cmd中运行:
pip install -e .
VNPY桌面应用使用
在VeighNa中使用 vnpy_tqsdk_edb 时,需要在全局配置中填写以下字段信息:
| 名称 | 含义 | 必填 | |
|---|---|---|---|
| datafeed.name | 名称 | 是 | tqsdk_edb |
| datafeed.username | 用户名 | 否 | |
| datafeed.password | 密码 | 否 |
桌面应用使用截图
代码使用
from vnpy.trader.datafeed import get_datafeed
from vnpy.trader.object import HistoryRequest
from vnpy.trader.constant import Exchange, Interval
import datetime
# 获取数据源
datafeed = get_datafeed()
# 构造查询请求
req = HistoryRequest(
symbol="ag2604",
exchange=Exchange.SHFE,
interval=Interval.DAILY,
start=datetime.datetime(2026, 1, 1),
end=datetime.datetime(2026, 2, 10)
)
# 查询历史数据
bars = datafeed.query_bar_history(req)
print(bars[0])
#打印结果如下:
BarData(gateway_name='EDB', extra=None, symbol='ag2604', exchange=<Exchange.SHFE: 'SHFE'>, datetime=datetime.datetime(2026, 1, 5, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Asia/Shanghai')), interval=<Interval.DAILY: 'd'>, volume=np.int64(671811), turnover=0, open_interest=np.int64(222892), open_price=np.int64(18200), high_price=np.int64(18399), low_price=np.int64(17926), close_price=np.int64(18247))
接口限制
免费访问限制(来自天勤 EDB 服务):
- 日线数据:任意历史区间
- 分钟线数据:最近 1 年
如需完整历史数据,请前往天勤官网购买专业版访问权限。
许可证
MIT License
Metadata
Release files for vnpy-tqsdk-edb 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vnpy_tqsdk_edb-1.0.3.tar.gz | 4.8 kB | Without provenance | Details for vnpy_tqsdk_edb-1.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vnpy_tqsdk_edb-1.0.3-py3-none-any.whl | Python 3 | none | any | Details for vnpy_tqsdk_edb-1.0.3-py3-none-any.whl |
Total release size: 9.8 kB
Release files / vnpy_tqsdk_edb-1.0.3.tar.gz
| Download URL | vnpy_tqsdk_edb-1.0.3.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6f62ca5db37919219b8b4be660dcfc062ddb0036eb49d3897ca12f1626dc496
|
|
BLAKE2b-256 checksum How to use checksums |
88f98622f37ac75c697b455610e78bf26b674ee1b1e94b1254ae48b3805b0a6d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Release files / vnpy_tqsdk_edb-1.0.3-py3-none-any.whl
| Download URL | vnpy_tqsdk_edb-1.0.3-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f604ff70fc7e5c8e54722e749e5e4360b576790eb6859c334964ec25055f0b5d
|
|
BLAKE2b-256 checksum How to use checksums |
24fb2e15bcf58484160df9b27bf81cfc6553909341ccdd4c2215dde9714c2fa0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Security for vnpy-tqsdk-edb 1.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.