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.1.tar.gz (664.2 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.1-cp313-cp313-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.13Windows x86-64

vnpy_esunny-9.0.3.16.1-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.1.tar.gz.

File metadata

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

File hashes

Hashes for vnpy_esunny-9.0.3.16.1.tar.gz
Algorithm Hash digest
SHA256 0724af783797baca7fe5b81bdf408779101048aa7925d45e001b685dd2bf1d72
MD5 3d431c2f11e82962a81cfc5b53db4750
BLAKE2b-256 2255e874b48512cf4209400e8b0e10672c53797397a71757588a6faa24f72682

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vnpy_esunny-9.0.3.16.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 76849aa30d5e588bc942d3180ce9167c20b4059209879ab0a2cc2645f1f7eebf
MD5 7ecf2c76ea713ecd8884dda7c6b11603
BLAKE2b-256 02c30e73954518591f60adae6fca77e588be93bab3193f258cee03944c2886ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vnpy_esunny-9.0.3.16.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b316344ac63df97f1d5c4545a4c9859fe2a0c14ff3bf4d751d6af1b86326101d
MD5 4013abe9ca3594578092483036d13b1d
BLAKE2b-256 32f87af1c53bf6b0002864bbe59fd86a9f298614e4d5842eee0a5a863fb38e6a

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