Skip to main content

Esunny gateway for VeighNa quant trading framework.

Project description

VeighNa框架的易盛底层接口

说明

基于易盛的启明星V9API的9.0.3.16接口封装开发,支持启明星后台系统,适用于内盘交易所交易。

安装

安装环境推荐基于4.3.0版本以上的【VeighNa Studio】。

直接使用pip命令:

pip install vnpy_esunny

或者下载源代码后,解压后在cmd中运行:

pip install .

使用源代码安装时需要进行C++编译,因此在执行上述命令之前请确保已经安装了【Visual Studio(Windows)】或者【GCC(Linux)】编译器。

使用

以脚本方式启动(script/run.py):

from vnpy.event import EventEngine
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import MainWindow, create_qapp

from vnpy_esunny import EsunnyGateway


def main():
    """主入口函数"""
    qapp = create_qapp()

    event_engine = EventEngine()
    main_engine = MainEngine(event_engine)
    main_engine.add_gateway(EsunnyGateway)
    
    main_window = MainWindow(main_engine, event_engine)
    main_window.showMaximized()

    qapp.exec()


if __name__ == "__main__":
    main()

gateway调整说明

对比之前基于易盛的启明星/北斗星兼容交易API的1.0.2.2接口封装开发的esunny_gateway.py,目前的esunny_gateway.py做了以下调整:

  1. QuoteApi中品种查询、合约查询以及行情订阅函数调用时都需要传入session(int)入参;

  2. TradeApi采用vnpy_tap中tap_gateway.py的方式,登录之后先查询资金、持仓、委托、成交推送一次,后续收到更新再继续推送;

  3. TradeApi调用insertOrder函数进行委托时,新增指定TacticsType策略单类型、TriggerCondition触发条件类型、TriggerPriceType触发价格类型字段传N,OrderSource委托来源字段传A(TAPI_ORDER_SOURCE_ESUNNY_API 易盛API)

  4. TradeApi调用insertOrder函数进行委托时,金交所合约的HedgeFlag投机保值/HedgeFlag2投机保值2都和期货委托一致,传TAPI_HEDGEFLAG_T投机(之前esunny_gateway.py中金交所合约是传TAPI_HEDGEFLAG_N无)

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_esunny-9.0.3.16.3.tar.gz (665.3 kB view details)

Uploaded Source

Built Distributions

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

vnpy_esunny-9.0.3.16.3-cp313-cp313-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.13Windows x86-64

vnpy_esunny-9.0.3.16.3-cp310-cp310-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.10Windows x86-64

File details

Details for the file vnpy_esunny-9.0.3.16.3.tar.gz.

File metadata

  • Download URL: vnpy_esunny-9.0.3.16.3.tar.gz
  • Upload date:
  • Size: 665.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.3

File hashes

Hashes for vnpy_esunny-9.0.3.16.3.tar.gz
Algorithm Hash digest
SHA256 2c0106888627e634cf9f782d09a798ed162f0a087053b7ead9e17e223ccd7973
MD5 585552b57c33b9bd7064fd094a030a41
BLAKE2b-256 78e7a33dec0d79b90f315cf2befc631fe0ad7cef3666b255f8ae783e7d6b4d02

See more details on using hashes here.

File details

Details for the file vnpy_esunny-9.0.3.16.3-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for vnpy_esunny-9.0.3.16.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 bb7ae2fc41f4622f967c2b6b9392d02d81ab3343920a0c49c44d7cf4b0acbb0f
MD5 6f756025a58980aafd44642bfd9a0f15
BLAKE2b-256 fa86663c0173eab1a97b0a07e59ffed1dad3f7e423509e40ac98375519ff4aac

See more details on using hashes here.

File details

Details for the file vnpy_esunny-9.0.3.16.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for vnpy_esunny-9.0.3.16.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 77ec4f2159e79d04707f818cbee625ed5320e14841c98cbba0ddc5081848eeae
MD5 5ddd6cb3f9340338160285d482154921
BLAKE2b-256 6edc20623b9f9a6372d5b184999a11146f296a11b25a68890f77b513313afba2

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