-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
env_setup.sh
executable file
ยท84 lines (67 loc) ยท 3.26 KB
/
env_setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
set -euo pipefail
# shellcheck disable=all
TOP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
# shellcheck disable=SC1091
source "${TOP_DIR}/scripts/qbot_base.sh"
wget https://repo.continuum.io/archive/Anaconda3-5.3.1-Linux-x86_64.sh
bash Anaconda3-5.3.1-Linux-x86_64.sh
info "export PATH=/home/$USER/anaconda3/bin:$PATH" | sudo tee -a ~/.bashrc
# shellcheck disable=SC1090
source ~/.bashrc
conda info --env
conda create -n qbot python=3.9
conda activate qbot
conda info --env
pip install -r requirements.txt
pip install -U wxpy
# make sure if local device
if [[ $"(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]]; then
set USER_ID="admin" # replace your info
set PASSWORD="admin1234." # replace your info
set MAIL_LICENSE="wafasqtakgywoobach" # replace your own 163.com / qq.com license
else #Darwin or Linux
export USER_ID="admin" # replace your info
export PASSWORD="admin1234." # replace your info
export MAIL_LICENSE="wafasqtakgywoobach" # replace your own 163.com / qq.com license
fi
info "Successful - Environment is set up!"
info "Enjoy, Qboter!"
echo -e "\e]8;;http://github.com/Charmve\aThis is Charmve's blog\e]8;;\a"
echo -e "\e[40;38;5;82m Alpha \e[30;48;5;82m Qbot \e[0m"
cat << EOF
โโโโโโโ โโโโโโโ โโโโโโโ โโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโ โโโโโโโโโโโโโโ โโโ โโโ
โโโโโ โโโโโโโโโโโโโโ โโโ โโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโ โโโ
โโโโโโโ โโโโโโโ โโโโโโโ โโโ
Alpha Qbot
++++=================================++++
auth: Charmve --V.0.1
๐ค Qbot = ๆบ่ฝไบคๆ็ญ็ฅ + ๅๆต็ณป็ป + ่ชๅจๅไบคๆ (+ ๅฏ่งๅๅๆๅทฅๅ
ท)
| | | |
| | | \_ quantstats (dashboard\online operate)
| | \______________ Qbot - vnpy, pytrader, pyfunds
| \__________________________ BackTest - backtrader, easyquant
\______________________________________ quant.ai - qlib, deep learning strategies
EOF
info "Run example backtest"
cd pytrader
python test_backtrade.py # run backtest
# python test_trader.py # run real trader test
# run python app
# make sure if local device
if [[ "$(uname)" == "Darwin" ]]; then
info "run on MacOS"
pythonw main.py
# server_ip=$(ifconfig en0|grep "inet "|awk '{print $2}'|awk -F: '{print $1}')
# shellcheck disable=SC2308
elif [[ "$(expr substr "$(uname -s)" 1 5)" == "Linux" ]]; then
python main.py
# server_ip=$(ifconfig eth0|grep "inet addr"|awk '{print $2}'|awk -F: '{print $2}')
# shellcheck disable=SC2308
elif [[ "$(expr substr "$(uname -s)" 1 10)" == "MINGW32_NT" ]]; then
warning "not support on WinOS."
fi
exit 0