Skip to content

Commit

Permalink
Update docs and add ci release
Browse files Browse the repository at this point in the history
  • Loading branch information
Charmve committed Sep 25, 2023
1 parent f01b7c6 commit 841af0e
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ labels: question

## ❓ Questions and Help

We sincerely suggest you to carefully read the [wiki](https://github.com/Charmve/Qbot/wiki) of our library. After that, if you still feel puzzled, please describe the question clearly under this issue.
We sincerely suggest you to carefully read the [wiki](https://ufund-me.github.io/Qbot/#/README?id=installation) of our library. After that, if you still feel puzzled, please describe the question clearly under this issue.
2 changes: 1 addition & 1 deletion .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "![](https://cdn.anishdoes.dev/githublight.png)\nHey @{user}! Welcome to the **QBOT** repo on **Github**."
issue-message: "<a href="https://github.com/UFund-Me"><img alt="image" src="https://github.com/UFund-Me/Qbot/assets/29084184/39c4e22f-bc3a-4d13-b213-9e101675b038"></a> \nHey @{user}! Welcome to the **QBOT** repo on **Github**."
pr-message: "Message that will be displayed on users' first pull request"

auto-lgtm:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/qbot-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "qbot-release"

# on:
# pull_request:
# paths-ignore:
# - 'data/**'
# - 'docs/**'
# - '*.md'
# push:
# branches:
# - main
# paths-ignore:
# - 'docs/**'
# - 'data/**'
# - '*.md'

.investool_release_template:


.fund_strategy_release_template:

.gui_release_template:


jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

release-for-mac:
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ v19.7.0

</details>

使用docker运行项目,在项目路径下运行以下命令构建项目的docker镜像
使用docker运行项目,在项目路径 `pyfunds/fund-strategies/` 下运行以下命令构建项目的docker镜像
```
docker build -t fund_strategy .
```
Expand All @@ -250,7 +250,7 @@ docker run -dp 8000:8000 fund_strategy --name="fund_strategy_instance"

等待项目启动过程中,可通过以下命令查看启动日志:
```
docker log -f fund_strategy_instance
docker logs -f fund_strategy_instance
```

启动后,可通过`http://locahost:8000`访问网页。
Expand Down Expand Up @@ -589,6 +589,8 @@ If you like the project, you can become a sponsor at [Open Collective](https://o

<a href=""><img align="left" alt="Go for it!" src="https://raw.githubusercontent.com/Charmve/computer-vision-in-action/main/res/ui/frontpage/2020-sponsors.svg" height="68" title="Do what you like, and do it best!"/></a>

## ♥️ Acknowledgements

<b>Last but not least, we're thankful to these open-source repo for sharing their services for free:</b>

基于 backtrader、[vnpy](https://github.com/vnpy/vnpy)[qlib](https://github.com/microsoft/qlib)、tushare、easyquant、[fund-strategies](https://github.com/SunshowerC/fund-strategy)[investool](https://github.com/axiaoxin-com/investool) 等开源项目,感谢开发者。
Expand Down
8 changes: 5 additions & 3 deletions auto_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@
# -*-coding=utf-8-*-

import os
import platform
import subprocess
import sys
import time
import urllib.request # noqa F401

import pandas as pd
import platform
if platform.system() == 'Darwin':

if platform.system() == "Darwin":
import pync

import tushare as ts

from utils.larkbot import LarkBot
Expand Down Expand Up @@ -125,7 +127,7 @@ def check(code, low, high):
bot.send(content="[Signal💡] 中国平安 低于 ¥49")

priceNow = 48
if platform.system() == 'Darwin':
if platform.system() == "Darwin":
pync.notify(
f'{"中国平安"}当前价格为{priceNow}',
title=f'Qbot - {"中国平安"}股票已低于设定值{49}',
Expand Down
6 changes: 4 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ docker run -dp 8000:8000 fund_strategy --name="fund_strategy_instance"

等待项目启动过程中,可通过以下命令查看启动日志:
```
docker log -f fund_strategy_instance
docker logs -f fund_strategy_instance
```

启动后,可通过`http://locahost:8000`访问网页。
Expand Down Expand Up @@ -581,9 +581,11 @@ If you like the project, you can become a sponsor at [Open Collective](https://o

<a href=""><img align="left" alt="Go for it!" src="https://raw.githubusercontent.com/Charmve/computer-vision-in-action/main/res/ui/frontpage/2020-sponsors.svg" height="68" title="Do what you like, and do it best!"/></a>

## ♥️ Acknowledgements

<b>Last but not least, we're thankful to these open-source repo for sharing their services for free:</b>

基于Backtrader、vnpyqlib、tushare、backtest、easyquant、fund-strategies、investool等开源项目,感谢开发者。
基于 backtrader、[vnpy](https://github.com/vnpy/vnpy)[qlib](https://github.com/microsoft/qlib)、tushare、easyquant、[fund-strategies](https://github.com/SunshowerC/fund-strategy)[investool](https://github.com/axiaoxin-com/investool) 等开源项目,感谢开发者。

<br><br>

Expand Down
8 changes: 4 additions & 4 deletions env_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ 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
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
Expand Down
Binary file added gui/imgs/github-badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gui/mainframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def __init__(self, *args, **kw):
web = WebPanel(self.m_notebook)
self.m_notebook.AddPage(web, "AI 选股/选基", True)
# run_invest_tool()
# web.show_url("https://investool.axiaoxin.com/?from=github")
web.show_url("http://localhost:4868/")
# web.show_url("https://investool.axiaoxin.com/?from=github")

web = WebPanel(self.m_notebook)
self.m_notebook.AddPage(web, "交易策略在线交易", True)
Expand Down
18 changes: 16 additions & 2 deletions gui/panels/panel_backtest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
'''
Author: Charmve yidazhang1@gmail.com
Date: 2023-05-20 16:37:34
LastEditors: Charmve yidazhang1@gmail.com
LastEditTime: 2023-09-20 10:16:19
FilePath: /Qbot/gui/panels/panel_backtest.py
Version: 1.0.1
Blogs: charmve.blog.csdn.net
GitHub: https://github.com/Charmve
Description:
Copyright (c) 2023 by Charmve, All Rights Reserved.
Licensed under the MIT License.
'''
import wx

from gui.config import DATA_DIR_BKT_RESULT
Expand All @@ -14,8 +28,8 @@ def __init__(self, parent):
super(PanelBacktest, self).__init__(parent)

# 回测按钮
self.btn_bkt = wx.Button(self, label="回测")
self.Bind(wx.EVT_BUTTON, OnBkt, self.btn_bkt)
# self.btn_bkt = wx.Button(self, label="回测")
# self.Bind(wx.EVT_BUTTON, OnBkt, self.btn_bkt)

# 进度条

Expand Down
4 changes: 2 additions & 2 deletions pyfunds/fund-strategies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
![](https://img.shields.io/badge/-%E8%B4%A2%E5%AF%8C%E8%87%AA%E7%94%B1-red)



无需数据库,通过 jsonp 借用基金网站的数据接口,根据历史数据,通过图表展示效果。

对历史的各个时间点,符合一定的条件时,进行某些投资策略,包括定投,止盈,补仓等投资操作,最后进行投资策略成果分析,通过图表展示效果。
Expand Down Expand Up @@ -63,7 +62,7 @@ docker run -dp 8000:8000 fund_strategy --name="fund_strategy_instance"

等待项目启动过程中,可通过以下命令查看启动日志:
```
docker log -f fund_strategy_instance
docker logs -f fund_strategy_instance
```

启动后,可通过`http://locahost:8000`访问网页
Expand All @@ -74,6 +73,7 @@ docker log -f fund_strategy_instance
开箱即用,[可在线访问]((http://sunshowerc.github.io/fund/))

### 基础回测功能

1. 输入你想要回测的基金,可以直接输入搜索。
2. 设置定投策略
3. 【可选】设置止盈策略
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ scikit-learn
empyrical
stable-baselines==2.10.0
jupyter
# Ta-Lib #download https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib
# gym==0.17.1
pyglet==1.5.0
tensorboard
Expand Down
3 changes: 2 additions & 1 deletion scripts/qbot_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ TOP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
# shellcheck disable=SC1090,SC1091
source "${TOP_DIR}/scripts/qbot_base.sh"

pip install -r requirements.txt

if pip show PyInstaller &> /dev/null; then
echo "PyInstaller 已经安装"
Expand All @@ -24,7 +25,7 @@ cd ~/Qbot
# 3、MAC打包
pyinstaller -w --clean -p gui/bkt_result/bkt_result.html -p pytrader/strategies/workflow_by_code.ipynb main.py
# 3、win打包
# pyinstaller -F -p 依赖包路径 入口文件.py
# pyinstaller -F -p 依赖包路径 main.py

# pip install PyInstaller
# pyi-makespec --onefile --windowed main.py
Expand Down
8 changes: 5 additions & 3 deletions utils/common/BaseService.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Author: Charmve yidazhang1@gmail.com
Date: 2023-03-10 00:45:44
LastEditors: Charmve yidazhang1@gmail.com
LastEditTime: 2023-03-12 20:10:22
LastEditTime: 2023-09-19 23:00:07
FilePath: /Qbot/utils/common/BaseService.py
Version: 1.0.1
Blogs: charmve.blog.csdn.net
Expand All @@ -22,7 +22,7 @@

import parsel
import requests
from configure.util import send_message_via_wechat
# from configure.util import send_message_via_wechat
from loguru import logger


Expand Down Expand Up @@ -162,7 +162,8 @@ def trading_time(self):
return NOON_STOP

def notify(self, title):
send_message_via_wechat(title)
print("send_message_via_wechat")
# send_message_via_wechat(title)

def weekday(self, day=datetime.datetime.now().strftime("%Y-%m-%d")):
"""判断星期几"""
Expand All @@ -180,6 +181,7 @@ def weekday(self, day=datetime.datetime.now().strftime("%Y-%m-%d")):
return day_diff.days % 7

def is_weekday(self, day=datetime.datetime.now().strftime("%Y-%m-%d")):
print(day)
if self.weekday(day) in [0, 6]:
return False
else:
Expand Down

0 comments on commit 841af0e

Please sign in to comment.