Git Product home page Git Product logo

quadquanta's Introduction

基于聚宽数据源和clickhouse数据库的本地量化回测系统

主要特点

数据源:聚宽

数据库:clickhouse

数据结构:全部为结构化numpy,加快计算的同时方便取数

测试阶段BUG多,勿用于生成环境

  • 日线
  • 1分钟线
  • 集合竞价
  • 复权

简明使用教程

安装clickhouse

参考clickhouse官网,用户名,密码可自行设置

安装QuadQuanta

pip 安装

pip install QuadQuanta

源码安装最新版

下载最新源码

git clone https://github.com/levonwoo/QuadQuanta.git

进入项目根目录

cd ./QuadQuanta

安装

python -m pip install -e .

使用示例

下载源码

git clone https://github.com/QuadQuanta/QuadQuanta.git

更新数据

运行./QuadQuanta/data/updata_daybar.py即可更新从2014-01-01开始的日线数据

首次会自动在用户目录创建~/.QuadQuanta/config.yaml文件,需要配置config.yaml文件后运行,以下是config.yaml文件示例

# 数据下载开始日期
start_date: '2014-01-01'
#聚宽账户
jqdata:
  username: 'yourusername' 
  passwd: 'yourpasswd'
# clickhouse配置
clickhouse:
  ip: '127.0.0.1'
  user: 'default'
  password: 'yourpasswrod' #无密码则为''
# mongodb配置
mongodb:
  uri: 'mongodb://127.0.0.1:27017'

修改config.yaml文件start_date项可修改开始时间,参考聚宽数据源的最早数据时间

示例

./QuadQuanta/examples/stock_picking.py文件为一个简易的选股示例

./QuadQuanta/examples/DoubleMA.py是一个简单的双均线策略示例

数据字段

日线,分钟线

fileds 类型 名称 注释
datetime bar数据结束时间
code 股票代码 六位纯数字代码
open 时间段开始时价格
close 时间段结束时价格
high 时间段中最高价
low 时间段中最低价
volume 时间段中的成交的股票数量
amount 时间段中的成交的金额
avg 时间段中的平均价
high_limit 当日涨停价
low_limit 当日跌停价
pre_close 前一个单位时间结束时的价格,按天则是前一天的收盘价
date 当日日期
date_stamp 日期时间戳

quadquanta's People

Contributors

naza3 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.