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

Uploaded Source

Built Distribution

vnpy_webtrader-1.0.5-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vnpy_webtrader-1.0.5.tar.gz
  • Upload date:
  • Size: 34.8 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.5.tar.gz
Algorithm Hash digest
SHA256 7d2203a7dd65dba5a9b5f28e717262c849f560c2f3587da12de6b0e24235bad9
MD5 846bb45d8cceb12d3905419d6247197c
BLAKE2b-256 d99d036eddbcf8e8c8b601682aa558fbe22cd836114d8e2b9a40348d8a27be61

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vnpy_webtrader-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 33.7 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 99c2413c0d5431b24f977a1a17bb9ebc07adb292d5c95d162ae2c2a3d90bd74c
MD5 de3f3a298e2bd4c7c95fe4b89292669a
BLAKE2b-256 b3173ab596ccc56cf2e15b8984a4db510ea7d25430b885e8123def0314b57725

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page