同步操作将从 功夫量化/kungfu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
功夫是 Taurus.ai 团队专为量化交易者设计的开源交易执行系统。功夫想要解决以下问题:
功夫系统架构如下:
功夫在系统设计上支持任意柜台的对接(涵盖中国所有股票、期货市场),目前功夫开源版仅提供 CTP 和 XTP 柜台对接的实现。 如果需要接入更多柜台请通过 kungfu-trader 官网联系我们。 开发者也可根据长拳标准自行开发新的柜台接口。
初次使用请参考 功夫交易系统用户手册
更多介绍请关注知乎专栏 硅商冲击。
功夫采用 Apache License 2.0 发布。
功夫的编译依赖以下工具: 支持 C++17 的编译器 Node.js (>=8 <11) yarn Python 3 pipenv cmake (>3.12)
功夫编译依赖 Node.js,建议预先进行如下设置加速依赖包的下载:
npm config set registry https://registry.npm.taobao.org
npm config set puppeteer_download_host https://npm.taobao.org/mirrors
npm config set electron_mirror https://npm.taobao.org/mirrors/electron/
npm config set sass-binary-site https://npm.taobao.org/mirrors/node-sass
npm config set npm_config_disturl=https://npm.taobao.org/mirrors/atom-shell
:electron-builder-binaries 这个依赖因为众所周知的原因可能会出现下载失败,可以通过 https://my.oschina.net/u/1240907/blog/1926061 这篇文章中的方法解决
brew install git cmake node@10
npm install -g yarn electron-builder
pip install pipenv
开发组在 Visual Studio 2017 15.9.14 环境下进行工作,安装时需要勾选 VC140(Visual Studio 2015) toolset。
下载并安装 git,Python 3,CMake,Node.js LTS 10.15.3 并添加相应路径至 %PATH% 环境变量。
C:\> npm install -g yarn electron-builder
C:\> pip install pipenv
注意不要使用 Win64 后缀的 generator,如果遇到如下报错:
CMake Error:
Generator
Visual Studio 15 2017 Win64
does not support platform specification, but platform
x64
was specified.
需要手动指定 cmake generator 之后重新编译:
npm config set cmake_js_G "Visual Studio 15 2017"
yarn clean
yarn build
确保编译器支持 C++ 17,例如对于 CentOS,升级 gcc 到 5.0 以上:
yum install rpm-build
yum -y install centos-release-scl
yum -y install devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutils
echo "source /opt/rh/devtoolset-8/enable" >> /etc/profile
source /etc/profile
$ # install cmake3 node.js
$ node-v10.15.3-linux-x64/bin/npm install -g yarn
$ pip install pipenv
获取代码并编译:
$ git clone https://github.com/taurusai/kungfu
$ cd kungfu
$ yarn
$ yarn build
编译结果输出在 app/build 目录下,例如在 MacOSX 系统上,最终的可执行文件输出在 app/build/mac/Kungfu.Trader.app。
遇到编译问题需要完整的重新编译时,执行以下命令清理临时文件:
$ yarn clean
功夫默认编译为 Release 模式(-DCMAKE_BUILD_TYPE="Release"),如果希望以 Debug 模式编译,需要执行以下命令:
$ npm config set kungfu-core:buildtype "Debug"
执行以下命令恢复 Release 模式:
$ npm config set kungfu-core:buildtype "Release"
切换编译模式后,需要执行以下命令重新生成配置文件:
$ yarn workspace kungfu-core run configure
编译过程会在代码所在目录下生成如下临时文件:
node_modules
build
dist
通常情况下可通过执行如下命令对 build 和 dist 进行清理:
$ yarn clean
需要注意 node_modules 目录为 npm 产生的包目录,一般情况下无需清除,如有特殊需要可手动删除。
另外,编译过程中会在系统的以下路径产生输出:
$HOME/.cmake-js # cmake.js 存储的 C++ 依赖包
$HOME/.virtualenvs # pipenv(windows) 存储的 Python 依赖
$HOME/.local/share/virtualenvs # pipenv(unix) 存储的 Python 依赖
如果需要清理这些文件,都需要手动删除。
开发文档即将上线,请关注 功夫 官网。 QQ 交流群 312745666,入群问题答案:kungfu.trader
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。