Skip to main content

Web trader application for VeighNa quant trading framework.

Project description

VeighNa框架的Web服务模块

说明

针对B-S架构需求设计的Web服务应用模块,实现了提供主动函数调用(REST)和被动数据推送(Websocket)的Web服务器。

目前仅提供了基础的交易和管理接口,用户根据自己的需求扩展支持其他VeighNa应用模块的Web接口(如CTA策略自动交易等)。

安装

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

直接使用pip命令:

pip install vnpy_webtrader

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

pip install .

架构

  • 基于Fastapi-Restful实现的主动函数调用功能,数据流程:

    1. 用户点击浏览器中的某个按钮,发起Restful功能调用;
    2. Web服务器收到Restful请求,将其转化为RPC功能调用发送给交易服务器;
    3. 交易服务器收到RPC请求,执行具体的功能逻辑,并返回结果;
    4. Web服务器返回Restful请求的结果给浏览器。
  • 基于Fastapi-Websocket实现的被动数据推送功能,数据流程:

    1. 交易服务器的事件引擎转发某个事件推送,并推送给RPC客户端(Web服务器);
    2. Web服务器收到事件推送后,将其转化为json格式,并通过Websocket发出;
    3. 浏览器通过Websocket收到推送的数据,并渲染在Web前端界面上。
  • 将程序分为两个进程的主要原因包括:

    1. 交易服务器中的策略运行和数据计算的运算压力较大,需要保证尽可能保证低延时效率;
    2. Web服务器需要面对互联网访问,将交易相关的逻辑剥离能更好保证安全性。

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_webtrader-1.0.4.tar.gz (34.5 kB view details)

Uploaded Source

Built Distribution

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

vnpy_webtrader-1.0.4-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file vnpy_webtrader-1.0.4.tar.gz.

File metadata

  • Download URL: vnpy_webtrader-1.0.4.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for vnpy_webtrader-1.0.4.tar.gz
Algorithm Hash digest
SHA256 8f0e711e497c6486aa219ca0056b72398629ad0e815558ff922c741960ca8f82
MD5 ceaa010ad9f8a0e15650378279d673b0
BLAKE2b-256 5db51e97bd03699c38de1e304a964314d3970530055ef5b93db57e57e4627a62

See more details on using hashes here.

File details

Details for the file vnpy_webtrader-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: vnpy_webtrader-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 32.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for vnpy_webtrader-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 aee19e40ebd41a3d7316643b4ce2cbbbed36e4cf3fb4a5f6f78e302b1e3031f3
MD5 05ccbb9cd4e28d87b2adbb5c21542554
BLAKE2b-256 afaf02d09ea06138faa0acc22e63db2c389d08736cea314aba77e5daf7953845

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