Skip to main content

vnpy使用天勤免费的EDB数据服务下载1分钟K线和日线数据

Project description

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 密码

桌面应用使用截图

image.png

image.png

image.png

image.png

image.png

代码使用

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

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

vnpy_tqsdk_edb-1.0.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

vnpy_tqsdk_edb-1.0.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file vnpy_tqsdk_edb-1.0.2.tar.gz.

File metadata

  • Download URL: vnpy_tqsdk_edb-1.0.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for vnpy_tqsdk_edb-1.0.2.tar.gz
Algorithm Hash digest
SHA256 73920b192a11a3f3e1c94abdacd1dd6bf4e602be633211d70905f917884e3544
MD5 36135745eca9c630460ed359f36ac2c4
BLAKE2b-256 cda003c31dae558fd015b2ae8b729f5ea986b429a1f69904aae5aca8171f18af

See more details on using hashes here.

File details

Details for the file vnpy_tqsdk_edb-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: vnpy_tqsdk_edb-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for vnpy_tqsdk_edb-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d7e7394e807ba211851d31ad02876262874900dc8ab66a9b90a9a5308d066a3c
MD5 e31825b0719cfcfba38b23e4073926ef
BLAKE2b-256 131250dc4bd7f0774f4ecb434412b501556c81d47cc6d800d728c0a23b6ed5c8

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