2017-07-15 09:02:47 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-10-10 15:54:52 +00:00
|
|
|
function check_result() {
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo " "
|
|
|
|
echo "do command failed for $1 !!!"
|
|
|
|
echo " "
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2017-07-15 10:36:19 +00:00
|
|
|
#Build ctp/lts/ib api
|
2018-11-07 10:29:13 +00:00
|
|
|
echo "是否要安装'CTP'接口? (Do you need 'CTP' interface?)"
|
2018-11-07 10:18:04 +00:00
|
|
|
read -p "Enter [y]n: " var1
|
|
|
|
var1=${var1:-y}
|
|
|
|
if [ "$var1" = "y" ]; then
|
|
|
|
pushd vnpy/api/ctp
|
|
|
|
bash build.sh
|
|
|
|
popd
|
|
|
|
fi
|
|
|
|
|
2018-11-07 10:29:13 +00:00
|
|
|
echo "是否要安装'LTS'接口? (Do you need 'LTS' interface?)"
|
2018-11-07 10:18:04 +00:00
|
|
|
read -p "Enter [y]n: " var1
|
|
|
|
var1=${var1:-y}
|
|
|
|
if [ "$var1" = "y" ]; then
|
|
|
|
pushd vnpy/api/lts
|
|
|
|
bash build.sh
|
|
|
|
popd
|
|
|
|
fi
|
|
|
|
|
2018-11-07 10:29:13 +00:00
|
|
|
echo "是否要安装'XTP'接口? (Do you need 'XTP' interface?)"
|
2018-11-07 10:18:04 +00:00
|
|
|
read -p "Enter [y]n: " var1
|
|
|
|
var1=${var1:-y}
|
|
|
|
if [ "$var1" = "y" ]; then
|
|
|
|
pushd vnpy/api/xtp
|
|
|
|
bash build.sh
|
|
|
|
popd
|
|
|
|
fi
|
|
|
|
|
2018-11-07 10:29:13 +00:00
|
|
|
echo "是否要安装'IB'接口? (Do you need 'IB' interface?)"
|
2018-11-07 10:18:04 +00:00
|
|
|
read -p "Enter [y]n: " var1
|
|
|
|
var1=${var1:-y}
|
|
|
|
if [ "$var1" = "y" ]; then
|
|
|
|
pushd vnpy/api/ib
|
|
|
|
bash build.sh
|
|
|
|
popd
|
|
|
|
fi
|
2017-07-15 09:02:47 +00:00
|
|
|
|
2017-07-15 10:36:19 +00:00
|
|
|
#Install Python Modules
|
2017-07-15 09:02:47 +00:00
|
|
|
pip install -r requirements.txt
|
|
|
|
|
2017-07-15 10:36:19 +00:00
|
|
|
#Install Ta-Lib
|
2017-07-20 01:53:08 +00:00
|
|
|
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
|
|
|
|
conda config --set show_channel_urls yes
|
2017-07-15 09:02:47 +00:00
|
|
|
conda install -c quantopian ta-lib=0.4.9
|
|
|
|
|
2017-07-15 10:36:19 +00:00
|
|
|
#Install vn.py
|
2017-07-15 09:02:47 +00:00
|
|
|
python setup.py install
|
|
|
|
|