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.0.tar.gz (664.1 kB view details)

Uploaded Source

Built Distribution

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

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

Uploaded CPython 3.13Windows x86-64

File details

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

File metadata

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

File hashes

Hashes for vnpy_esunny-9.0.3.16.0.tar.gz
Algorithm Hash digest
SHA256 02e1d9dde024b518807ac8077fd5ac221da8940b8c902aa17d2d75a78df0a14d
MD5 6fc5f58d7e2ffd4e6a9bd74c247766da
BLAKE2b-256 3ffcaad5fc5990586a96ec21b6bb632c36c998ce79b44a6c02acdd94aecc6963

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vnpy_esunny-9.0.3.16.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1a61c36b8988174bcd277a83718cb09c5a7640ec11abb23cd5fabda7195dbf4b
MD5 f9b695418f57393852f902d506f43c05
BLAKE2b-256 2339ff7e1ed1c2f2c6529bd3d57e17c87af78e4ee2c7323afbb94eb09f6e9e42

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