Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
R
robo-dividend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenwen.tang
robo-dividend
Commits
0d0ee9cb
Commit
0d0ee9cb
authored
Jun 26, 2025
by
wenwen.tang
😕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新config-mdis_prr3.yml数据库连接配置与投组元数据,升级lxml版本要求,web端新增推荐概览功能
parent
3234e299
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
3 deletions
+28
-3
config-mdis_prr3.yml
config-mdis_prr3.yml
+5
-2
requirements.txt
requirements.txt
+1
-1
robo_controller.py
web/robo_controller.py
+22
-0
No files found.
config-mdis_prr3.yml
View file @
0d0ee9cb
...
...
@@ -30,10 +30,10 @@ py-jftech:
level
:
${LOG_LEVEL:INFO}
handlers
:
${LOG_HANDLERS:[ console ]}
database
:
host
:
${MYSQL_HOST:192.168.68.
85
}
host
:
${MYSQL_HOST:192.168.68.
121
}
port
:
${MYSQL_PORT:3306}
user
:
${MYSQL_USER:root}
password
:
${MYSQL_PWD:
changeit
}
password
:
${MYSQL_PWD:
12345678
}
dbname
:
${MYSQL_DBNAME:mdis_prr3}
# mdis_prr3
injectable
:
names
:
...
...
@@ -262,6 +262,9 @@ web:
guid
:
AB088E61-FAB1-4466-B6AD-6E8AE253391E
port
:
8080
save-path
:
${EXPORT_PATH:json}
name
:
"
科技帶路投組"
feature
:
"
科技為主
x
其他產業為輔
x
風險調控"
tag
:
"
卡位時機"
requirements.txt
View file @
0d0ee9cb
...
...
@@ -3,7 +3,7 @@ charset-normalizer==2.1.1
empyrical
==0.5.5
et-xmlfile
==1.1.0
idna
==3.4
lxml
=
=4.9.0
lxml
>
=4.9.0
numpy
==1.23.4
openpyxl
==3.0.10
pandas
==1.5.1
...
...
web/robo_controller.py
View file @
0d0ee9cb
...
...
@@ -82,6 +82,17 @@ def load_report(max_date=None, min_date=None, combo: RoboReportor = None):
return
cp
,
roi
,
risk
def
build_overview
(
asset_weights
:
dict
):
overview
=
{
"name"
:
get_config
(
'web.name'
),
"feature"
:
get_config
(
'web.feature'
),
"tag"
:
get_config
(
'web.tag'
),
"month"
:
dt
.
date
.
today
()
.
strftime
(
"
%
m月"
),
"setting"
:
[{
"name"
:
k
,
"rate"
:
v
}
for
k
,
v
in
asset_weights
.
items
()]
}
return
overview
@
app
.
get
(
"/franklin/recommend"
)
async
def
recommend
():
sig
=
get_today_rec
()
...
...
@@ -111,16 +122,27 @@ async def recommend():
sum
(
weight
*
100
for
key
,
weight
in
funds
.
items
()
if
id_ticker_map
[
key
][
'assetType'
]
==
'STOCK'
))
data
[
"p_note"
]
=
f
"{stock_weight}:{100 - stock_weight}"
portfolios
[
'data'
]
=
data
# funds根据assetType分类,计算比重
asset_weights
=
{}
for
key
,
weight
in
funds
.
items
():
asset_type
=
id_ticker_map
[
key
][
'assetType'
]
if
asset_type
not
in
asset_weights
:
asset_weights
[
asset_type
]
=
0
asset_weights
[
asset_type
]
+=
weight
*
100
overview
=
build_overview
(
asset_weights
)
portfolios
[
'overview'
]
=
overview
rec_list
.
append
(
portfolios
)
return
rec_list
else
:
return
{
'msg'
:
'当日投组未产生,待10:30后获取'
}
@
app
.
get
(
"/franklin/recommend/save"
)
async
def
recommend_save
():
await
save_json
()
return
{
'msg'
:
'保存成功'
}
# 其他异常处理程序
@
app
.
exception_handler
(
Exception
)
async
def
general_exception_handler
(
request
:
Request
,
exc
:
Exception
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment