commit
4d277c71d2
14
.travis.yml
14
.travis.yml
@ -27,7 +27,7 @@ matrix:
|
|||||||
include:
|
include:
|
||||||
- name: "code quality analysis: flake8"
|
- name: "code quality analysis: flake8"
|
||||||
before_install:
|
before_install:
|
||||||
- pip install flake8
|
- python -m pip install flake8
|
||||||
install:
|
install:
|
||||||
- "" # prevent running "pip install -r requirements.txt"
|
- "" # prevent running "pip install -r requirements.txt"
|
||||||
script:
|
script:
|
||||||
@ -48,7 +48,7 @@ matrix:
|
|||||||
# update pip & setuptools
|
# update pip & setuptools
|
||||||
- python -m pip install --upgrade pip wheel setuptools
|
- python -m pip install --upgrade pip wheel setuptools
|
||||||
# Linux install script
|
# Linux install script
|
||||||
- pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
|
- python -m pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
|
||||||
- bash ./install.sh
|
- bash ./install.sh
|
||||||
|
|
||||||
- name: "sdist install under Ubuntu: gcc-7"
|
- name: "sdist install under Ubuntu: gcc-7"
|
||||||
@ -73,11 +73,11 @@ matrix:
|
|||||||
- make
|
- make
|
||||||
- sudo make install
|
- sudo make install
|
||||||
- popd
|
- popd
|
||||||
- pip install numpy
|
- python -m pip install numpy
|
||||||
- pip install --pre --extra-index-url https://rquser:ricequant99@py.ricequant.com/simple/ rqdatac
|
- python -m pip install --pre --extra-index-url https://rquser:ricequant99@py.ricequant.com/simple/ rqdatac
|
||||||
- pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
|
- python -m pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
|
||||||
- python setup.py sdist
|
- python setup.py sdist
|
||||||
- pip install dist/`ls dist`
|
- python -m pip install dist/`ls dist`
|
||||||
|
|
||||||
- name: "pip install under osx"
|
- name: "pip install under osx"
|
||||||
os: osx
|
os: osx
|
||||||
@ -85,7 +85,7 @@ matrix:
|
|||||||
services: []
|
services: []
|
||||||
before_install: []
|
before_install: []
|
||||||
install:
|
install:
|
||||||
- pip3 install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
|
- python3 -m pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
|
||||||
- bash ./install_osx.sh
|
- bash ./install_osx.sh
|
||||||
before_script: []
|
before_script: []
|
||||||
script:
|
script:
|
||||||
|
@ -53,10 +53,10 @@ for:
|
|||||||
- configuration: sdist
|
- configuration: sdist
|
||||||
build_script:
|
build_script:
|
||||||
- python setup.py sdist
|
- python setup.py sdist
|
||||||
- pip install --pre --extra-index-url https://rquser:ricequant99@py.ricequant.com/simple/ rqdatac
|
- python -m pip install --pre --extra-index-url https://rquser:ricequant99@py.ricequant.com/simple/ rqdatac
|
||||||
- pip install https://pip.vnpy.com/colletion/TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl
|
- python -m pip install https://pip.vnpy.com/colletion/TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl
|
||||||
- pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
|
- python -m pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
|
||||||
- ps: $name=(ls dist).name; pip install "dist/$name"
|
- ps: $name=(ls dist).name; python -m pip install "dist/$name"
|
||||||
|
|
||||||
test_script:
|
test_script:
|
||||||
- cd tests
|
- cd tests
|
||||||
|
@ -231,6 +231,10 @@ register_event()函数分别注册2种事件:EVENT_CONTRACT、EVENT_TICK
|
|||||||
|
|
||||||
## 移除记录
|
## 移除记录
|
||||||
|
|
||||||
|
移除记录操作:输入需要移除合约品种的本地代码,如rb1905.SHFE。该本地代码必须在“Tick记录列表” 或者“K线记录列表”中。若要移除Tick记录,只需在”Tick记录“那一栏上点击”移除“按钮即可。
|
||||||
|
|
||||||
|
下面展示代码运作原理:
|
||||||
|
|
||||||
- 从tick_recordings字典移除vt_symbol
|
- 从tick_recordings字典移除vt_symbol
|
||||||
- 调用save_setting()函数保存json配置文件
|
- 调用save_setting()函数保存json配置文件
|
||||||
- 推送最新的tick_recordings字典来继续记录行情,原来移除合约品种不再记录。
|
- 推送最新的tick_recordings字典来继续记录行情,原来移除合约品种不再记录。
|
||||||
@ -252,6 +256,8 @@ register_event()函数分别注册2种事件:EVENT_CONTRACT、EVENT_TICK
|
|||||||
|
|
||||||
## 停止记录
|
## 停止记录
|
||||||
|
|
||||||
|
停止记录操作:只需手动关闭行情记录模块窗口就停止记录行情。
|
||||||
|
|
||||||
- 记录行情状态改为False, 停止while循环;
|
- 记录行情状态改为False, 停止while循环;
|
||||||
- 调用join()函数关掉线程。
|
- 调用join()函数关掉线程。
|
||||||
|
|
||||||
|
@ -43,6 +43,12 @@
|
|||||||
* [穷举算法](cta_backtester.md#穷举算法)
|
* [穷举算法](cta_backtester.md#穷举算法)
|
||||||
* [遗传算法](cta_backtester.md#遗传算法)
|
* [遗传算法](cta_backtester.md#遗传算法)
|
||||||
|
|
||||||
|
* [行情记录](datarecoder.md)
|
||||||
|
* [加载启动](datarecoder.md#加载启动)
|
||||||
|
* [开始收录](datarecoder.md#开始收录)
|
||||||
|
* [移除记录](datarecoder.md#移除记录)
|
||||||
|
* [停止记录](datarecoder.md#停止记录)
|
||||||
|
|
||||||
|
|
||||||
* [交易接口](gateway.md)
|
* [交易接口](gateway.md)
|
||||||
* [如何连接](gateway.md#如何连接)
|
* [如何连接](gateway.md#如何连接)
|
||||||
|
13
install.bat
13
install.bat
@ -1,10 +1,13 @@
|
|||||||
|
:: Upgrade pip & setuptools
|
||||||
|
python -m pip install --upgrade pip setuptools
|
||||||
|
|
||||||
::Install talib and ibapi
|
::Install talib and ibapi
|
||||||
pip install https://pip.vnpy.com/colletion/rqdatac-2.1.0.tar.gz
|
python -m pip install https://pip.vnpy.com/colletion/rqdatac-2.1.0.tar.gz
|
||||||
pip install https://pip.vnpy.com/colletion/TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl
|
python -m pip install https://pip.vnpy.com/colletion/TA_Lib-0.4.17-cp37-cp37m-win_amd64.whl
|
||||||
pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
|
python -m pip install https://pip.vnpy.com/colletion/ibapi-9.75.1-001-py3-none-any.whl
|
||||||
|
|
||||||
::Install Python Modules
|
::Install Python Modules
|
||||||
pip install -r requirements.txt
|
python -m pip install -r requirements.txt
|
||||||
|
|
||||||
:: Install vn.py
|
:: Install vn.py
|
||||||
pip install .
|
python -m pip install .
|
18
install.sh
18
install.sh
@ -1,13 +1,13 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
python=$1
|
python=$1
|
||||||
pip=$2
|
prefix=$2
|
||||||
prefix=$3
|
|
||||||
|
|
||||||
[[ -z $python ]] && python=python
|
[[ -z $python ]] && python=python
|
||||||
[[ -z $pip ]] && pip=pip
|
|
||||||
[[ -z $prefix ]] && prefix=/usr
|
[[ -z $prefix ]] && prefix=/usr
|
||||||
|
|
||||||
|
$python -m pip install --upgrade pip setuptools wheel
|
||||||
|
|
||||||
# Get and build ta-lib
|
# Get and build ta-lib
|
||||||
pushd /tmp
|
pushd /tmp
|
||||||
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
|
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
|
||||||
@ -19,18 +19,18 @@ sudo make install
|
|||||||
popd
|
popd
|
||||||
|
|
||||||
# old versions of ta-lib imports numpy in setup.py
|
# old versions of ta-lib imports numpy in setup.py
|
||||||
$pip install numpy
|
$python -m pip install numpy
|
||||||
|
|
||||||
# Install extra packages
|
# Install extra packages
|
||||||
$pip install --pre --extra-index-url https://rquser:ricequant99@py.ricequant.com/simple/ rqdatac
|
$python -m pip install --pre --extra-index-url https://rquser:ricequant99@py.ricequant.com/simple/ rqdatac
|
||||||
$pip install ta-lib
|
$python -m pip install ta-lib
|
||||||
$pip install https://vnpy-pip.oss-cn-shanghai.aliyuncs.com/colletion/ibapi-9.75.1-py3-none-any.whl
|
$python -m pip install https://vnpy-pip.oss-cn-shanghai.aliyuncs.com/colletion/ibapi-9.75.1-py3-none-any.whl
|
||||||
|
|
||||||
# Install Python Modules
|
# Install Python Modules
|
||||||
$pip install -r requirements.txt
|
$python -m pip install -r requirements.txt
|
||||||
|
|
||||||
# Install local Chinese language environment
|
# Install local Chinese language environment
|
||||||
sudo locale-gen zh_CN.GB18030
|
sudo locale-gen zh_CN.GB18030
|
||||||
|
|
||||||
# Install vn.py
|
# Install vn.py
|
||||||
$pip install .
|
$python -m pip install .
|
@ -1,3 +1,3 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
bash ./install.sh python3 pip3 /usr/local
|
bash ./install.sh python3 /usr/local
|
13
setup.py
13
setup.py
@ -107,6 +107,15 @@ else:
|
|||||||
|
|
||||||
pkgs = find_packages()
|
pkgs = find_packages()
|
||||||
|
|
||||||
|
|
||||||
|
def is_psycopg2_exists():
|
||||||
|
try:
|
||||||
|
import psycopg2 # noqa
|
||||||
|
return True
|
||||||
|
except ImportError:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
install_requires = [
|
install_requires = [
|
||||||
"PyQt5<5.12",
|
"PyQt5<5.12",
|
||||||
"qdarkstyle",
|
"qdarkstyle",
|
||||||
@ -114,7 +123,6 @@ install_requires = [
|
|||||||
"websocket-client",
|
"websocket-client",
|
||||||
"peewee",
|
"peewee",
|
||||||
"pymysql",
|
"pymysql",
|
||||||
"psycopg2",
|
|
||||||
"mongoengine",
|
"mongoengine",
|
||||||
"numpy",
|
"numpy",
|
||||||
"pandas",
|
"pandas",
|
||||||
@ -127,6 +135,9 @@ install_requires = [
|
|||||||
"ibapi",
|
"ibapi",
|
||||||
"deap"
|
"deap"
|
||||||
]
|
]
|
||||||
|
if not is_psycopg2_exists():
|
||||||
|
install_requires.append("psycopg2-binary")
|
||||||
|
|
||||||
if sys.version_info.minor < 7:
|
if sys.version_info.minor < 7:
|
||||||
install_requires.append("dataclasses")
|
install_requires.append("dataclasses")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user