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.3.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.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vnpy_tqsdk_edb-1.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 a6f62ca5db37919219b8b4be660dcfc062ddb0036eb49d3897ca12f1626dc496
MD5 a063a7e75a0cc2a048f652b8c8b809d7
BLAKE2b-256 88f98622f37ac75c697b455610e78bf26b674ee1b1e94b1254ae48b3805b0a6d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vnpy_tqsdk_edb-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f604ff70fc7e5c8e54722e749e5e4360b576790eb6859c334964ec25055f0b5d
MD5 8fa7c4c455071ee68a06ea148d5246f1
BLAKE2b-256 24fb2e15bcf58484160df9b27bf81cfc6553909341ccdd4c2215dde9714c2fa0

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