Skip to main content

MySQL database adapter for VeighNa quant trading framework.

Project description

VeighNa框架的MySQL数据库接口

说明

基于peewee开发的MySQL数据库接口。

使用

全局配置

在VeighNa中使用MySQL时,需要在全局配置中填写以下字段信息:

名称 含义 必填 举例
database.name 名称 mysql
database.host 地址 localhost
database.port 端口 3306
database.database 实例 vnpy
database.user 用户名 root
database.password 密码 123456

创建实例(Schema)

VeighNa不会主动为MySQL数据库创建实例,所以使用前请确保database.database字段中填写的的数据库实例已经创建了。

若实例尚未创建,可以使用【MySQL Workbench】客户端的【new_schema】进行操作。

字符串大小写敏感支持

由于peewee的建表功能限制,默认情况下在保存合约代码的【symbol】字段时,无法区分字符串大小写。如果影响使用,可按照以下方式手动修改MySQL数据表来解决:

# 用MySQL命令行工具连接数据库

# 选择数据实例
use vnpy;

# 修改四张表symbol字段的BINARY属性
ALTER TABLE `dbbaroverview` MODIFY COLUMN `symbol` VARCHAR(45) BINARY;

ALTER TABLE `dbtickoverview` MODIFY COLUMN `symbol` VARCHAR(45) BINARY;

ALTER TABLE `dbbardata` MODIFY COLUMN `symbol` VARCHAR(45) BINARY;

ALTER TABLE `dbtickdata` MODIFY COLUMN `symbol` VARCHAR(45) BINARY;

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_mysql-1.0.2.tar.gz (7.5 kB view hashes)

Uploaded source

Built Distribution

vnpy_mysql-1.0.2-py3-none-any.whl (7.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page