Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
F
fund_report
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭熊
fund_report
Commits
e027a0cb
Commit
e027a0cb
authored
Dec 10, 2020
by
赵杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新版本多组合循环
parent
663ac031
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2559 additions
and
0 deletions
+2559
-0
monthReportV2.1.html
app/templates/v2/monthReportV2.1.html
+2241
-0
jinjia2html_v2.py
app/utils/jinjia2html_v2.py
+318
-0
No files found.
app/templates/v2/monthReportV2.1.html
0 → 100644
View file @
e027a0cb
<!doctype html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<style>
/*
* Prefixed by https://autoprefixer.github.io
* PostCSS: v7.0.29,
* Autoprefixer: v9.7.6
* Browsers: last 4 version
*/
.all
{
width
:
1200px
;
margin
:
0
auto
;
page-break-inside
:
avoid
;
}
.clearfix
:after
{
content
:
""
;
display
:
block
;
clear
:
both
;
overflow
:
hidden
;
}
.fl
{
float
:
left
;
}
.fr
{
float
:
right
;
}
.dtable
{
display
:
table
;
}
.dcell
{
display
:
table-cell
;
vertical-align
:
middle
;
}
/* 封面 */
.box0
{
display
:
{{
box0
}
}
;
position
:
relative
;
padding
:
234px
0
184px
0
;
}
.box0
.cover_head
{
position
:
absolute
;
top
:
45px
;
right
:
38px
;
}
.box0
.cover_head
.cover_logo
{
width
:
172px
;
height
:
52px
;
}
.box0
.cover_head
.cover_line
{
width
:
1px
;
height
:
34px
;
background
:
#10316E
;
margin
:
0
10px
0
10px
;
}
.box0
.cover_head
.cover_text
{
font-size
:
17px
;
line-height
:
23px
;
color
:
#B6172B
;
font-weight
:
bold
;
}
.box0
.cover_people
{
padding
:
0
38px
0
858px
;
}
.box0
.cover_people
.cover_pre
{
margin
:
0
20px
0
0
;
font-size
:
28px
;
line-height
:
40px
;
color
:
#999999
;
font-weight
:
bold
;
}
.box0
.cover_people
.cover_name
{
font-size
:
32px
;
line-height
:
45px
;
color
:
#B6172B
;
font-weight
:
bold
;
}
.box0
.cover_people
.cover_sir
{
font-size
:
28px
;
line-height
:
45px
;
color
:
#333333
;
font-weight
:
bold
;
}
.box0
.cover_back
{
display
:
block
;
width
:
100%
;
height
:
218px
;
}
.box0
.cover_date
{
padding
:
0
0
0
858px
;
}
.box0
.cover_date
.cover_time
{
display
:
inline-block
;
font-size
:
40px
;
line-height
:
66px
;
color
:
#ffffff
;
font-weight
:
bold
;
padding
:
0
66px
0
66px
;
background
:
#B6172B
;
-webkit-box-shadow
:
0px
10px
26px
0px
rgba
(
66
,
5
,
5
,
0.18
);
box-shadow
:
0px
10px
26px
0px
rgba
(
66
,
5
,
5
,
0.18
);
border
:
1px
solid
#979797
;
}
.box0
.cover_title
{
position
:
absolute
;
top
:
100px
;
left
:
211px
;
z-index
:
1
;
width
:
282px
;
height
:
514px
;
background
:
#B6172B
;
-webkit-box-shadow
:
0px
10px
26px
0px
rgba
(
66
,
5
,
5
,
0.44
);
box-shadow
:
0px
10px
26px
0px
rgba
(
66
,
5
,
5
,
0.44
);
border
:
1px
solid
#979797
;
}
.box0
.cover_title
.cover_title_text
{
padding
:
0
30px
0
50px
;
font-size
:
46px
;
line-height
:
61px
;
color
:
#ffffff
;
font-weight
:
bold
;
}
.box_line
{
height
:
15px
;
background
:
#F1F1F1
;
}
/* 目录 */
.box1
{
display
:
{{
box1
}
}
;
position
:
relative
;
padding
:
150px
0
200px
36px
;
}
.box1
.catalog_line
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
36px
;
height
:
100%
;
background
:
#B6172B
;
}
.box1
.catalog_box
.catalog_item
:first-child
{
width
:
562px
;
padding
:
0
46px
0
46px
;
}
.box1
.catalog_box
.catalog_item
.catalog_en
{
font-size
:
72px
;
line-height
:
77px
;
color
:
#333333
;
font-weight
:
bold
;
opacity
:
0.45
;
}
.box1
.catalog_box
.catalog_item
.catalog_ch
{
margin
:
30px
0
0
0
;
font-size
:
58px
;
line-height
:
77px
;
color
:
#333333
;
font-weight
:
bold
;
}
.box1
.catalog_box
.catalog_item
.catalog_li
{
position
:
relative
;
}
.box1
.catalog_box
.catalog_item
.catalog_li
.catalog_dot
{
position
:
absolute
;
top
:
32px
;
left
:
0
;
width
:
16px
;
height
:
16px
;
background
:
#D7D7D7
;
border-radius
:
50%
;
}
.box1
.catalog_box
.catalog_item
.catalog_li
.catalog_name
{
padding
:
0
0
0
40px
;
font-size
:
32px
;
line-height
:
77px
;
color
:
#333333
;
font-weight
:
bold
;
}
/* 页眉 */
.page
{
padding
:
54px
34px
10px
34px
;
width
:
100%
;
border-bottom
:
1px
solid
#F1F1F1
;
}
.page
.page_title
{
width
:
880px
;
font-size
:
40px
;
line-height
:
56px
;
color
:
#333333
;
font-weight
:
bold
;
}
.page
.page_head
.page_logo
{
width
:
172px
;
height
:
52px
;
}
.page
.page_head
.page_line
{
width
:
1px
;
height
:
34px
;
background
:
#10316E
;
margin
:
0
10px
0
10px
;
}
.page
.page_head
.page_text
{
font-size
:
17px
;
line-height
:
23px
;
color
:
#B6172B
;
font-weight
:
bold
;
white-space
:
nowrap
;
}
/* 投资总览 */
.box2
{
display
:
{{
box2
}
}
;
}
.box2
.box2_content
{
padding
:
47px
34px
61px
34px
;
page-break-after
:
always
;
}
/* 表格样式1 */
.tss1
{
margin
:
30px
0
0
0
;
}
.tss1
.tss1_title
{
font-size
:
24px
;
line-height
:
33px
;
color
:
#333333
;
font-weight
:
bold
;
margin
:
0
0
15px
0
;
}
.tss1
.tss1_table
{
width
:
100%
;
border-collapse
:
collapse
;
}
.tss1
.tss1_table
tr
{
border-bottom
:
2px
solid
#FFFFFF
;
background
:
#F1F1F1
;
width
:
100%
;
}
.tss1
.tss1_table
tr
td
{
width
:
25%
;
padding
:
12px
26px
12px
26px
;
font-size
:
16px
;
line-height
:
22px
;
color
:
#333333
;
font-weight
:
bold
;
}
.tss1
.tss1_table
tr
td
.red
{
color
:
#D10000
;
}
.tss1
.tss1_table
tr
td
.green
{
color
:
#129298
;
}
/* 表格样式2 */
.tss2
{
margin
:
40px
0
0
0
;
}
.tss2
.tss2_title
{
font-size
:
24px
;
line-height
:
33px
;
color
:
#333333
;
font-weight
:
bold
;
margin
:
0
0
15px
0
;
}
.tss2
.tss2_content
{
margin
:
18px
0
0
0
;
border
:
1px
solid
#E4E4E4
;
}
.tss2
.tss2_content
.tss2_img
{
width
:
100%
;
}
/* 表格样式3 */
.tss3
{
margin
:
40px
0
0
0
;
}
.tss3
.tss3_head
{
width
:
100%
;
}
.tss3
.tss3_head
.tss3_title
{
font-size
:
24px
;
line-height
:
33px
;
color
:
#333333
;
font-weight
:
bold
;
margin
:
0
0
15px
0
;
}
.tss3
.tss3_head
.tss3_title
.tss3_start_time
{
font-size
:
18px
;
line-height
:
33px
;
color
:
#666666
;
font-weight
:
normal
;
}
.tss3
.tss3_head
.tss3_now_time
{
font-size
:
14px
;
line-height
:
20px
;
color
:
#333333
;
text-align
:
right
;
}
.tss3
.tss3_tag
{
position
:
absolute
;
padding
:
0
16px
0
26px
;
font-size
:
16px
;
line-height
:
30px
;
color
:
#ffffff
;
background
:
#A2A2A2
;
}
.tss3
.tss3_tag
.tss3_tri
{
position
:
absolute
;
top
:
0
;
right
:
-10px
;
border-top
:
15px
solid
#A2A2A2
;
border-bottom
:
15px
solid
transparent
;
border-left
:
5px
solid
#A2A2A2
;
border-right
:
5px
solid
transparent
;
}
.tss3
table
{
margin
:
24px
0
0
0
;
width
:
100%
;
border
:
none
;
border-color
:
rgba
(
151
,
151
,
151
,
0.18
);
border-collapse
:
collapse
;
}
.tss3
table
tr
{
position
:
relative
;
font-size
:
14px
;
line-height
:
20px
;
color
:
#333333
;
text-align
:
center
;
vertical-align
:
middle
;
}
.tss3
table
tr
.yellow
{
background
:
#FFFAF2
;
}
.tss3
table
tr
.gray
{
background
:
#F1F1F1
;
}
.tss3
table
tr
th
{
padding
:
14px
0
14px
0
;
background
:
#F1F1F1
;
}
.tss3
table
tr
td
{
padding
:
14px
0
14px
0
;
}
.tss3
table
tr
td
.gray
{
background
:
#F1F1F1
;
}
.tss3
table
tr
td
.text_red
{
color
:
#D00000
;
}
.tss3
table
tr
td
.text_green
{
color
:
#22A236
;
}
.tss3
table
tr
td
.summary
{
font-size
:
18px
;
line-height
:
25px
;
color
:
#333333
;
font-weight
:
bold
;
}
.tss3
.tss3_tip
{
margin
:
10px
0
0
0
;
font-size
:
12px
;
line-height
:
17px
;
color
:
#333333
;
}
/* 目标与业绩 */
.box3
{
display
:
{{
box3
}
}
;
}
.box3
.box3_content
{
padding
:
47px
34px
61px
34px
;
page-break-after
:
always
;
}
/* 收益比较、相关性分析 */
.par
{
margin
:
47px
0
0
0
;
width
:
100%
;
}
.par
.par_item
{
width
:
540px
;
}
.par
.par_item
.par_title
{
font-size
:
24px
;
line-height
:
33px
;
color
:
#333333
;
font-weight
:
bold
;
margin
:
0
0
15px
0
;
}
.par
.par_item
.par_content
{
margin
:
18px
0
0
0
;
border
:
1px
solid
#E4E4E4
;
}
.par
.par_item
.par_content.relative_chart
{
padding
:
27px
30px
40px
30px
;
}
.par
.par_item
.par_content.relative_chart
table
{
width
:
100%
;
border-collapse
:
collapse
;
border
:
none
;
border-color
:
#D8D8D8
;
}
.par
.par_item
.par_content.relative_chart
table
td
{
padding
:
14px
0
14px
0
;
text-align
:
center
;
}
.par
.par_item
.par_content
.par_img
{
width
:
100%
;
}
.rcc_left
{
width
:
10%
;
-webkit-box-orient
:
vertical
;
-webkit-box-direction
:
normal
;
-ms-flex-direction
:
column
;
flex-direction
:
column
;
}
.rcc_column
{
border
:
1px
solid
transparent
;
}
.rcc_n
{
border
:
1px
solid
transparent
;
margin
:
9px
;
width
:
20px
;
height
:
20px
;
border-radius
:
50%
;
background
:
#999999
;
font-size
:
12px
;
line-height
:
20px
;
color
:
#FFFFFF
;
text-align
:
center
;
}
.rcc_right
{
width
:
90%
;
}
.rcc_index
{
display
:
inline-block
;
margin
:
0
auto
;
width
:
20px
;
height
:
20px
;
border-radius
:
50%
;
background
:
rgba
(
53
,
63
,
83
,
0.5
);
font-size
:
12px
;
line-height
:
20px
;
color
:
#FFFFFF
;
text-align
:
center
;
}
.rcc_number
{
font-size
:
12px
;
line-height
:
18px
;
color
:
#666666
;
}
.rc_tooltip
{
margin
:
16px
0
0
0
;
text-align
:
center
;
}
.rct_color
{
display
:
inline-block
;
}
.rct_color_item
{
border
:
1
PX
solid
#FFFFFF
;
width
:
38px
;
height
:
11px
;
}
.rtc_number_item
{
margin
:
0
12px
0
0
;
font-size
:
12px
;
line-height
:
18px
;
color
:
#666666
;
}
.rct_number
{
display
:
inline-block
;
}
.rc_label
{
margin
:
16px
14px
0
14px
;
-ms-flex-wrap
:
wrap
;
flex-wrap
:
wrap
;
}
.rcl_item
{
width
:
50%
;
position
:
relative
;
margin
:
4px
0
4px
0
;
}
.rcl_item_number
{
position
:
absolute
;
top
:
2px
;
left
:
0
;
margin
:
0
8px
0
0
;
width
:
20px
;
height
:
20px
;
border-radius
:
50%
;
background
:
#999999
;
font-size
:
12px
;
line-height
:
20px
;
color
:
#FFFFFF
;
text-align
:
center
;
}
.rcl_item_name
{
padding
:
0
10px
0
30px
;
font-size
:
16px
;
line-height
:
24px
;
color
:
#333333
;
}
.level_color1
{
background
:
#993612
;
color
:
#993612
;
}
.level_color2
{
background
:
#C58E7B
;
color
:
#C58E7B
;
}
.level_color3
{
background
:
#E9D4CD
;
color
:
#E9D4CD
;
}
.level_color4
{
background
:
#C4E4E6
;
color
:
#C4E4E6
;
}
.level_color5
{
background
:
#87C8CB
;
color
:
#87C8CB
;
}
.level_color6
{
background
:
#129298
;
color
:
#129298
;
}
/* 业绩的明细 */
.box4
{
display
:
{{
box4
}
}
;
}
.box4
.box4_content
{
padding
:
47px
34px
61px
34px
;
page-break-after
:
always
;
}
/* 个基点评 */
.box5
{
display
:
{{
box5
}
}
;
}
.box5
.box5_content
{
padding
:
47px
34px
61px
34px
;
page-break-after
:
always
;
}
.geji_list_wrap
.self_item
{
background
:
#FFFFFF
;
-webkit-box-shadow
:
0px
8px
9px
0px
rgba
(
0
,
0
,
0
,
0.05
);
box-shadow
:
0px
8px
9px
0px
rgba
(
0
,
0
,
0
,
0.05
);
border-radius
:
8px
;
border
:
1px
solid
#E4E4E4
;
margin
:
0
0
34px
0
;
}
.geji_list_wrap
.self_item
:last-child
{
margin
:
0
0
0
0
;
}
.geji_list_wrap
.self_item
.self_item_left
{
width
:
710px
;
padding
:
35px
36px
35px
0
;
}
.geji_list_wrap
.self_item
.self_item_left
.self_header
{
display
:
inline-block
;
font-size
:
0
;
}
.geji_list_wrap
.self_item
.self_item_left
.self_header
.self_title
{
position
:
relative
;
padding
:
0
10px
0
20px
;
font-size
:
24px
;
line-height
:
33px
;
color
:
#333333
;
font-weight
:
bold
;
}
.geji_list_wrap
.self_item
.self_item_left
.self_header
.self_title
.self_title_tri
{
width
:
0
;
height
:
0
;
border-bottom
:
20px
solid
transparent
;
border-top
:
20px
solid
#6C71AA
;
border-right
:
5px
solid
transparent
;
border-left
:
5px
solid
#6C71AA
;
position
:
absolute
;
right
:
-10px
;
top
:
0
;
}
.geji_list_wrap
.self_item
.self_item_left
.self_header
.self_type
{
margin
:
4px
0
0
0
;
padding
:
0
10px
0
10px
;
font-size
:
18px
;
line-height
:
26px
;
color
:
#4C4C4C
;
font-weight
:
bold
;
background
:
#E5E3E3
;
}
.geji_list_wrap
.self_item
.self_item_left
.self_header
.self_type.red
{
color
:
#983612
;
background
:
#FFEAE2
;
}
.geji_list_wrap
.self_item
.self_item_left
.self_header
.self_type.green
{
color
:
#22999F
;
background
:
#E2F7F8
;
}
.geji_list_wrap
.self_item
.self_item_left
.self_description
{
margin
:
20px
0
0
20px
;
}
.geji_list_wrap
.self_item
.self_item_left
.self_description
.self_description_item
{
position
:
relative
;
margin
:
0
0
10px
0
;
}
.geji_list_wrap
.self_item
.self_item_left
.self_description
.self_description_item
:last-child
{
margin
:
0
;
}
.geji_list_wrap
.self_item
.self_item_left
.self_description
.self_description_item
.self_description_dot
{
position
:
absolute
;
left
:
0
;
top
:
8px
;
width
:
6px
;
height
:
6px
;
border-radius
:
50%
;
background
:
#CBCBCB
;
}
.geji_list_wrap
.self_item
.self_item_left
.self_description
.self_description_item
.self_description_text
{
font-size
:
16px
;
line-height
:
22px
;
color
:
#666666
;
text-align
:
justify
;
padding-left
:
18px
;
}
.geji_list_wrap
.self_item
.self_item_left
.self_description
.self_description_item
.self_description_text
.self_description_red
{
color
:
#983612
;
}
.geji_list_wrap
.self_item
.self_item_left
.self_description
.self_description_item
.self_description_text
.self_description_green
{
color
:
#129298
;
}
.geji_list_wrap
.self_item
.self_item_right
{
margin
:
30px
26px
30px
26px
;
}
.geji_list_wrap
.self_item
.self_item_right
.self_img
{
width
:
100%
;
}
/*持仓组合点评*/
.target_comment
{
margin
:
36px
0
0
0
;
}
.target_comment
.comment_title
{
display
:
inline-block
;
position
:
relative
;
padding
:
4px
10px
4px
20px
;
border-radius
:
8px
0
0px
0px
;
background
:
#B6172B
;
font-size
:
24px
;
line-height
:
33px
;
color
:
#FFFFFF
;
}
.target_comment
.comment_title
.comment_tri
{
width
:
0
;
height
:
0
;
border-top
:
20px
solid
transparent
;
border-bottom
:
20px
solid
#B6172B
;
border-left
:
10px
solid
#B6172B
;
border-right
:
10px
solid
transparent
;
position
:
absolute
;
right
:
-20px
;
bottom
:
0
;
}
.target_comment
.comment_content
{
padding
:
39px
26px
39px
26px
;
background
:
#F7F7F7
;
}
.target_comment
.comment_content
.comment_item
{
width
:
100%
;
position
:
relative
;
}
.target_comment
.comment_content
.comment_dot
{
position
:
absolute
;
top
:
16px
;
left
:
0px
;
width
:
8px
;
height
:
8px
;
border-radius
:
50%
;
background
:
#666666
;
}
.target_comment
.comment_content
.comment_text
{
padding-left
:
24px
;
font-size
:
18px
;
line-height
:
42px
;
color
:
#666666
;
}
.target_comment
.comment_content
.comment_text
.comment_tag_red
{
color
:
#A75435
;
}
.target_comment
.comment_content
.comment_text
.comment_tag_green
{
color
:
#129298
;
}
/* 优化组合建议 */
.box6
{
display
:
{{
box6
}
}
;
}
.box6
.box6_content
{
padding
:
47px
34px
61px
34px
;
page-break-after
:
always
;
}
/* 新增基金 */
.box7
{
display
:
{{
box7
}
}
;
}
.box7
.box7_content
{
padding
:
47px
34px
61px
34px
;
page-break-after
:
always
;
}
/* 结尾 */
.box8
{
display
:
{{
box8
}
}
;
}
.box8
.box8_content
{
padding
:
60px
0
60px
0
;
}
.financial_show
.financial_left
{
width
:
763px
;
background
:
#B6172B
;
padding
:
58px
0
48px
0
;
}
.financial_show
.financial_left
.financial_scene
{
border-top
:
1px
solid
#B6172B
;
border-bottom
:
1px
solid
#B6172B
;
position
:
relative
;
height
:
305px
;
}
.financial_show
.financial_left
.financial_scene
.financial_scene_img
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
-o-object-fit
:
cover
;
object-fit
:
cover
;
}
.financial_show
.financial_left
.financial_scene
.financial_scene_text
{
margin
:
31px
77px
0
79px
;
font-size
:
26px
;
line-height
:
49px
;
color
:
#FFFFFF
;
letter-spacing
:
4px
;
position
:
relative
;
z-index
:
1
;
}
.financial_show
.financial_left
.financial_scene
.financial_scene_author
{
margin
:
0
77px
34px
79px
;
font-size
:
26px
;
line-height
:
49px
;
color
:
#FFFFFF
;
text-align
:
right
;
position
:
relative
;
z-index
:
1
;
}
.financial_show
.financial_show_right
{
background
:
#F7F7F7
;
padding
:
58px
0
48px
0
;
}
.financial_show
.financial_show_right
.financial_team
{
height
:
305px
;
}
.financial_show
.financial_show_right
.financial_team
.financial_team_img
{
/*width: 100%;*/
/*height: 100%;*/
/*-o-object-fit: cover;*/
/*object-fit: cover;*/
width
:
auto
;
height
:
100%
;
-o-object-fit
:
cover
;
object-fit
:
cover
;
}
.statement_content
{
padding
:
27px
31px
0
31px
;
}
.statement_content
.statement_block
{
margin
:
0
0
20px
0
;
}
.statement_content
.statement_block
.statement_title
{
margin
:
0
0
10px
0
;
font-size
:
10px
;
line-height
:
27px
;
color
:
#717171
;
font-weight
:
bold
;
text-align
:
justify
;
}
.statement_content
.statement_block
.statement_p
{
margin
:
0
0
10px
0
;
font-size
:
10px
;
line-height
:
27px
;
color
:
#717171
;
text-align
:
justify
;
}
.statement_content
.statement_block
.statement_title2
{
font-size
:
10px
;
line-height
:
27px
;
color
:
#333333
;
font-weight
:
bold
;
text-align
:
justify
;
}
</style>
</head>
<body>
<div
class=
"all"
>
<!-- 封面 -->
<div
class=
"box0"
>
<div
class=
"cover_head dtable"
>
<div
class=
"dcell"
>
<img
src=
{{logo}}
alt=
""
class=
"cover_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"cover_line"
></div>
</div>
<div
class=
"dcell"
>
<div
class=
"cover_text"
>
小飞象
<br>
工作室
</div>
</div>
</div>
<div
class=
"cover_people"
>
<span
class=
"cover_pre"
>
敬呈
</span>
<span
class=
"cover_name"
>
{{customer_name}}
</span>
<span
class=
"cover_sir"
>
客户
</span>
</div>
<img
src=
{{cover_back}}
alt=
""
class=
"cover_back"
>
<div
class=
"cover_date"
>
<div
class=
"cover_time"
>
{{year_month}}
</div>
</div>
<div
class=
"cover_title dtable"
>
<div
class=
"cover_title_text dcell"
>
资产
<br>
存续报告
</div>
</div>
</div>
<div
class=
"box_line"
></div>
<!-- 目录 -->
<div
class=
"box1"
>
<div
class=
"catalog_line"
></div>
<div
class=
"catalog_box dtable"
>
<div
class=
"catalog_item dcell"
>
<div
class=
"catalog_en"
>
Contents
</div>
<div
class=
"catalog_ch"
>
目录
</div>
</div>
<div
class=
"catalog_item dcell"
>
<div
class=
"catalog_li"
>
<div
class=
"catalog_dot"
></div>
<div
class=
"catalog_name"
>
投资总览
</div>
</div>
<div
class=
"catalog_li"
>
<div
class=
"catalog_dot"
></div>
<div
class=
"catalog_name"
>
目标与业绩
</div>
</div>
<div
class=
"catalog_li"
>
<div
class=
"catalog_dot"
></div>
<div
class=
"catalog_name"
>
业绩的明细
</div>
</div>
<!-- <div class="catalog_li">-->
<!-- <div class="catalog_dot"></div>-->
<!-- <div class="catalog_name">优化建议</div>-->
<!-- </div>-->
</div>
</div>
</div>
<div
class=
"box_line"
></div>
<!-- 投资总览 -->
<div
class=
"box2"
style=
"page-break-before:always;"
>
<div
class=
"page dtable"
>
<div
class=
"page_title dcell"
>
投资总览
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
</div>
<div
class=
"dcell"
>
<div
class=
"page_text"
>
{{brand_name}}
</div>
</div>
</div>
</div>
<div
class=
"box2_content"
>
<!-- 组合投资表现 -->
<div
class=
"tss1"
style=
"margin: 0;"
>
<div
class=
"tss1_title"
>
组合投资表现
</div>
<table
class=
"tss1_table"
>
<tr>
<td>
{%if month_rise>=0%}
本月涨幅:
<span
class=
"red"
>
{{month_rise}}%
</span>
{%else%}
本月涨幅:
<span
class=
"green"
>
{{month_rise}}%
</span>
{%endif%}
</td>
<td>
{%if now_month_income>=0%}
本月收益:
<span
class=
"red"
>
{{now_month_income}}元
</span>
{%else%}
本月收益:
<span
class=
"green"
>
{{now_month_income}}元
</span>
{%endif%}
</td>
<td>
{%if year_totoal_rate_of_return>=0%}
今年累计收益率:
<span
class=
"red"
>
{{year_totoal_rate_of_return}}%
</span>
{%else%}
今年累计收益率:
<span
class=
"green"
>
{{year_totoal_rate_of_return}}%
</span>
{%endif%}
</td>
<td>
{%if now_year_income>=0%}
今年累计收益:
<span
class=
"red"
>
{{now_year_income}}元
</span>
{%else%}
今年累计收益:
<span
class=
"green"
>
{{now_year_income}}元
</span>
{%endif%}
</td>
</tr>
<tr>
<td>
{%if now_yield>=0%}
成立以来累计收益率:
<span
class=
"red"
>
{{now_yield}}%
</span>
{%else%}
成立以来累计收益率:
<span
class=
"green"
>
{{now_yield}}%
</span>
{%endif%}
</td>
<td>
{%if now_annualised_return>=0%}
年化收益率:
<span
class=
"red"
>
{{now_annualised_return}}%
</span>
{%else%}
年化收益率:
<span
class=
"green"
>
{{now_annualised_return}}%
</span>
{%endif%}
</td>
<td>
{%if now_withdrawal>=0%}
最大回撤:
<span
class=
"red"
>
{{now_withdrawal}}%
</span>
{%else%}
最大回撤:
<span
class=
"green"
>
{{now_withdrawal}}%
</span>
{%endif%}
</td>
<td>
</td>
</tr>
</table>
</div>
<!-- 资产盈亏情况 -->
<div
class=
"tss1"
>
<div
class=
"tss1_title"
>
资产盈亏情况
</div>
<table
class=
"tss1_table"
>
<tr>
<td>
投资成本:
<span
class=
"red"
>
{{now_allocation_amount}}元
</span>
</td>
<td>
{%if final_balance>=now_allocation_amount%}
期末资产:
<span
class=
"red"
>
{{final_balance}}元
</span>
{%else%}
期末资产:
<span
class=
"green"
>
{{final_balance}}元
</span>
{%endif%}
</td>
<td>
{%if total_profit>=0%}
累计盈利:
<span
class=
"red"
>
{{total_profit}}元
</span>
{%else%}
累计盈利:
<span
class=
"green"
>
{{total_profit}}元
</span>
{%endif%}
</td>
<td>
</td>
</tr>
</table>
</div>
<!-- 组合月度及累计回报率曲线 -->
<div
class=
"tss2"
>
<div
class=
"tss2_title"
>
组合月度及累计回报率曲线
</div>
<div
class=
"tss2_content"
>
<img
src=
{{monthly_return_performance_pic}}
alt=
""
class=
"tss2_img"
>
</div>
</div>
<!-- 组合月度及累计回报率曲线 -->
<div
class=
"tss3"
>
<div
class=
"tss3_head dtable"
>
<div
class=
"tss3_title dcell"
>
组合月度及累计回报率曲线
</div>
</div>
<table
border=
"1"
>
<tr>
<th>
年份
</th>
<th>
金额(万)
</th>
<th>
1月
</th>
<th>
2月
</th>
<th>
3月
</th>
<th>
4月
</th>
<th>
5月
</th>
<th>
6月
</th>
<th>
7月
</th>
<th>
8月
</th>
<th>
9月
</th>
<th>
10月
</th>
<th>
11月
</th>
<th>
12月
</th>
<!-- <th>-->
<!-- 累计/月均-->
<!-- </th>-->
</tr>
{%for key, value in monthly_table_return.items() %}
<tr
class=
"yellow"
>
<td
rowspan=
"2"
class=
"gray"
>
{{key}}
</td>
<td>
盈亏
</td>
<td
class=
"text_red"
>
{{value[1]["profit"]}}
</td>
<td
class=
"text_green"
>
{{value[2]["profit"]}}
</td>
<td>
{{value[3]["profit"]}}
</td>
<td>
{{value[4]["profit"]}}
</td>
<td>
{{value[5]["profit"]}}
</td>
<td>
{{value[6]["profit"]}}
</td>
<td>
{{value[7]["profit"]}}
</td>
<td>
{{value[8]["profit"]}}
</td>
<td>
{{value[9]["profit"]}}
</td>
<td>
{{value[10]["profit"]}}
</td>
<td>
{{value[11]["profit"]}}
</td>
<td>
{{value[12]["profit"]}}
</td>
</tr>
<tr>
<td>
期末资产
</td>
<td
class=
"text_red"
>
{{value[1]["net_amount"]}}
</td>
<td
class=
"text_green"
>
{{value[2]["net_amount"]}}
</td>
<td>
{{value[3]["net_amount"]}}
</td>
<td>
{{value[4]["net_amount"]}}
</td>
<td>
{{value[5]["net_amount"]}}
</td>
<td>
{{value[6]["net_amount"]}}
</td>
<td>
{{value[7]["net_amount"]}}
</td>
<td>
{{value[8]["net_amount"]}}
</td>
<td>
{{value[9]["net_amount"]}}
</td>
<td>
{{value[10]["net_amount"]}}
</td>
<td>
{{value[11]["net_amount"]}}
</td>
<td>
{{value[12]["net_amount"]}}
</td>
</tr>
{%endfor%}
</table>
</div>
</div>
</div>
<div
class=
"box_line"
></div>
{%for folio, group_result in all_folio_result.items()%}
<!-- 目标与业绩 -->
<div
class=
"box3"
>
<div
class=
"page dtable"
>
<div
class=
"page_title dcell"
>
{%if folio == "default"%}
目标与业绩
{%else%}
目标与业绩({{folio}})
{%endif%}
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
</div>
<div
class=
"dcell"
>
<div
class=
"page_text"
>
{{brand_name}}
</div>
</div>
</div>
</div>
<div
class=
"box3_content"
>
<!-- 投资目标 -->
<div
class=
"tss3"
style=
"margin: 0;"
>
<div
class=
"tss3_head dtable"
>
<div
class=
"tss3_title dcell"
>
投资目标
</div>
</div>
<table
border=
"1"
>
<tr>
<th>
现有配置资金(万元)
</th>
<th>
现有年化收益情况(%)
</th>
<th>
现有最大回撤(%)
</th>
</tr>
<tr>
<td>
{{group_result["cost_of_investment"]}}
</td>
<td>
{{group_result["annualised_return"]}}
</td>
<td>
{{group_result["max_withdrawal"]}}
</td>
</tr>
</table>
<table
border=
"1"
style=
"margin: 0;"
>
<tr>
<th>
计划配置资金(万元)
</th>
<th>
目标年化收益情况(%)
</th>
<th>
目标最大回撤(%)
</th>
</tr>
<tr>
<td>
{{group_result["cost_of_investment"]}}
</td>
<td>
5%-10%
</td>
<td>
5%-10%
</td>
</tr>
</table>
</div>
<!-- 指标对比 -->
<div
class=
"tss3"
>
<div
class=
"tss3_head dtable"
>
<div
class=
"tss3_title dcell"
>
指标对比
<span
class=
"tss3_start_time"
>
(起始日期{{start_date}})
</span>
</div>
<div
class=
"tss3_now_time dcell"
>
截止日:最新净值日({{latest_worth_day}})
</div>
</div>
<table
border=
"1"
>
<tr>
<th>
类型
</th>
<th>
区间收益(%)
</th>
<th>
年化收益(%)
</th>
<th>
波动率(%)
</th>
<th>
最大回撤(%)
</th>
<th>
夏普比率
</th>
</tr>
<tr>
<tr
class=
"yellow"
>
<td>
{{group_result["old_indicator_compare"][0]["group_name"]}}
</td>
<td>
{{group_result["old_indicator_compare"][0]["return_ratio"]}}
</td>
<td>
{{group_result["old_indicator_compare"][0]["return_ratio_year"]}}
</td>
<td>
{{group_result["old_indicator_compare"][0]["volatility"]}}
</td>
<td>
{{group_result["old_indicator_compare"][0]["max_drawdown"]}}
</td>
<td>
{{group_result["old_indicator_compare"][0]["sharpe"]}}
</td>
</tr>
<tr
>
<td>
{{group_result["old_indicator_compare"][1]["group_name"]}}
</td>
<td>
{{group_result["old_indicator_compare"][1]["return_ratio"]}}
</td>
<td>
{{group_result["old_indicator_compare"][1]["return_ratio_year"]}}
</td>
<td>
{{group_result["old_indicator_compare"][1]["volatility"]}}
</td>
<td>
{{group_result["old_indicator_compare"][1]["max_drawdown"]}}
</td>
<td>
{{group_result["old_indicator_compare"][1]["sharpe"]}}
</td>
</tr>
</table>
<div
class=
"tss3_tip"
>
注:以上指标自持仓首日开始计算,结果仅供参考,如果持仓时间过短会造成指标失真的情况。
</div>
</div>
<!-- 收益比较、相关性分析 -->
<div
class=
"par clearfix"
cellpadding=
"38"
>
<div
class=
"par_item fl"
>
<div
class=
"par_title"
>
收益比较
</div>
<div
class=
"par_content"
>
<img
src=
{{group_result["old_return_compare_pic"]}}
alt=
""
class=
"par_img"
>
</div>
</div>
<div
class=
"par_item fr"
>
<div
class=
"par_title"
>
相关性分析
</div>
<div
class=
"par_content relative_chart"
>
<div
class=
"rc_chart clearfix"
>
<div
class=
"rcc_left fl"
>
<table
border=
"1"
style=
"border-color: transparent;margin-right: 20px;"
>
{% for correlation in group_result["old_correlation"] %}
<tr>
<td>
<span
class=
"rcc_index"
>
{{correlation[0]}}
</span>
</td>
</tr>
{% endfor %}
</table>
</div>
<div
class=
"rcc_right fr"
>
<table
border=
"1"
>
{% for correlation in group_result["old_correlation"] %}
<tr>
{% for i in range(correlation[2]|length) %}
{% if i == correlation[0] - 1 %}
<td>
<span
class=
"rcc_index"
>
{{correlation[0]}}
</span>
</td>
{% elif -1
<
=
correlation
[
2
][
i
]
<
-0
.
5
and
i
<
correlation
[
0
]
-
1
%}
<
td
>
{{correlation[2][i]}}
</td>
{% elif -1
<
=
correlation
[
2
][
i
]
<
-0
.
5
%}
<
td
class=
"level_color6"
>
{{correlation[2][i]}}
</td>
{% elif -0.5
<
=
correlation
[
2
][
i
]
<
-0
.
25
and
i
<
correlation
[
0
]
-
1
%}
<
td
>
{{correlation[2][i]}}
</td>
{% elif -0.5
<
=
correlation
[
2
][
i
]
<
-0
.
25
%}
<
td
class=
"level_color5"
>
{{correlation[2][i]}}
</td>
{% elif -0.25
<
=
correlation
[
2
][
i
]
<
0
and
i
<
correlation
[
0
]
-
1
%}
<
td
>
{{correlation[2][i]}}
</td>
{% elif -0.25
<
=
correlation
[
2
][
i
]
<
0
%}
<
td
class=
"level_color4"
>
{{correlation[2][i]}}
</td>
{% elif 0
<
=
correlation
[
2
][
i
]
<
0
.
25
and
i
<
correlation
[
0
]
-
1
%}
<
td
>
{{correlation[2][i]}}
</td>
{% elif 0
<
=
correlation
[
2
][
i
]
<
0
.
25
%}
<
td
class=
"level_color3"
>
{{correlation[2][i]}}
</td>
{% elif 0.25
<
=
correlation
[
2
][
i
]
<
0
.
5
and
i
<
correlation
[
0
]
-
1
%}
<
td
>
{{correlation[2][i]}}
</td>
{% elif 0.25
<
=
correlation
[
2
][
i
]
<
0
.
5
%}
<
td
class=
"level_color2"
>
{{correlation[2][i]}}
</td>
{% elif 0.5
<
=
correlation
[
2
][
i
]
<=
1
and
i
<
correlation
[
0
]
-
1
%}
<
td
>
{{correlation[2][i]}}
</td>
{% elif 0.5
<
=
correlation
[
2
][
i
]
<=
1
%}
<
td
class=
"level_color1"
>
{{correlation[2][i]}}
</td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</table>
</div>
</div>
<div
class=
"rc_tooltip"
>
<div
class=
"rct_color clearfix"
>
<div
class=
"rct_color_item fl level_color1"
></div>
<div
class=
"rct_color_item fl level_color2"
></div>
<div
class=
"rct_color_item fl level_color3"
></div>
<div
class=
"rct_color_item fl level_color4"
></div>
<div
class=
"rct_color_item fl level_color5"
></div>
<div
class=
"rct_color_item fl level_color6"
></div>
</div>
</div>
<div
class=
"rc_tooltip"
style=
"margin: 0;"
>
<div
class=
"rct_number clearfix"
>
<div
class=
"rtc_number_item fl"
>
1.00
</div>
<div
class=
"rtc_number_item fl"
>
0.50
</div>
<div
class=
"rtc_number_item fl"
>
0.25
</div>
<div
class=
"rtc_number_item fl"
>
0.00
</div>
<div
class=
"rtc_number_item fl"
>
-0.25
</div>
<div
class=
"rtc_number_item fl"
>
-0.50
</div>
<div
class=
"rtc_number_item fl"
>
-1.00
</div>
</div>
</div>
<div
class=
"rc_label clearfix"
>
{% for correlation in group_result["old_correlation"] %}
<div
class=
"rcl_item fl"
>
<div
class=
"rcl_item_number"
>
{{correlation[0]}}
</div>
<div
class=
"rcl_item_name"
>
{{correlation[1]}}
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"box_line"
></div>
<!-- 业绩的明细 -->
<div
class=
"box4"
>
<div
class=
"page dtable"
>
<div
class=
"page_title dcell"
>
业绩的明细
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
</div>
<div
class=
"dcell"
>
<div
class=
"page_text"
>
{{brand_name}}
</div>
</div>
</div>
</div>
<div
class=
"box4_content"
>
<!-- 持仓收益汇总 -->
<div
class=
"tss3"
style=
"margin: 0;"
>
<div
class=
"tss3_head dtable"
>
<div
class=
"tss3_title dcell"
>
持仓收益汇总
</div>
<div
class=
"tss3_now_time dcell"
>
截止日:最新净值日({{latest_worth_day}})
</div>
</div>
<div
style=
"position: relative;"
>
<div
class=
"tss3_tag"
>
私募基金
<div
class=
"tss3_tri"
></div>
</div>
<table
border=
"1"
>
<tr>
<th
colspan=
"5"
>
投资本金
</th>
<th
colspan=
"4"
>
{{month}}月业绩
</th>
<th
colspan=
"3"
>
累计业绩
</th>
</tr>
<tr>
<th>
投资策略
</th>
<th>
基金简称
</th>
<th>
买入时间
</th>
<th>
存续年数
</th>
<th>
投资本金 (万)
</th>
<th>
当月收益 (万)
</th>
<th>
当月收益率 (%)
</th>
<th>
月末市值 (万)
</th>
<th>
月末占比 (%)
</th>
<th>
累计收益 (万)
</th>
<th>
累计收益率 (%)
</th>
<th>
年化收益率 (%)
</th>
</tr>
{% for one in group_result["group_hoding_info"] %}
<tr>
<td
rowspan=
"1"
>
{{one.fund_strategy_name}}
</td>
<td>
{{one.fund_name}}
</td>
<td>
{{one.confirm_date}}
</td>
<td>
{{one.hold_year}}
</td>
<td>
{{one.cost}}
</td>
<td>
{{one.profit}}
</td>
<td>
{{one.month_return_ratio}}
</td>
<td>
{{one.market_values}}
</td>
<td>
{{one.weight}}
</td>
<td>
{{one.cum_profit}}
</td>
<td>
{{one.cum_profit_ratio}}
</td>
<td>
{{one.return_ratio_year}}
</td>
</tr>
{% endfor %}
<tr
class=
"gray"
>
<td
colspan=
"4"
>
总计
</td>
<td>
{{group_result["group_hoding_info_total"]["total_cost"]}}
</td>
<td>
{{group_result["group_hoding_info_total"]["cur_month_profit"]}}
</td>
<td>
{{group_result["group_hoding_info_total"]["cur_month_profit_ratio"]}}
</td>
<td>
{{group_result["group_hoding_info_total"]["ending_assets"]}}
</td>
<td>
100%
</td>
<td>
{{group_result["group_hoding_info_total"]["cumulative_profit"]}}
</td>
<td>
{{group_result["group_hoding_info_total"]["cumulative_return"]}}
</td>
<td>
{{group_result["group_hoding_info_total"]["return_ratio_year"]}}
</td>
</tr>
</table>
</div>
</div>
<!-- 基金净值 -->
<div
class=
"tss3"
>
<div
class=
"tss3_head dtable"
>
<div
class=
"tss3_title dcell"
>
基金净值
</div>
<div
class=
"tss3_now_time dcell"
>
截止日:最新净值日({{latest_worth_day}})
</div>
</div>
<table
border=
"1"
>
<tr>
<th
rowspan=
"2"
>
基金简称
</th>
<th
rowspan=
"2"
>
申购净值
</th>
<th
colspan=
"2"
>
最新净值({{latest_worth_day}})
</th>
<th
colspan=
"7"
>
收益率(%)
</th>
<th
rowspan=
"2"
>
分红
</th>
</tr>
<tr>
<th>
单位净值
</th>
<th>
累计净值
</th>
<th>
较上周
</th>
<th>
申购以来
</th>
<th>
近一月
</th>
<th>
近半年
</th>
<th>
近一年
</th>
<th>
今年以来
</th>
<th>
成立以来
</th>
</tr>
{% for nav_info in group_result["group_nav_info"] %}
<tr>
<td>
{{nav_info['fund_name']}}
</td>
<td>
{{nav_info['confirm_nav']}}
</td>
<td>
{{nav_info['cur_nav']}}
</td>
<td>
{{nav_info['cur_cnav']}}
</td>
<td>
{{nav_info['ret_1w']}}
</td>
<td>
{{nav_info['ret_after_confirm']}}
</td>
<td>
{{nav_info['ret_cum_1m']}}
</td>
<td>
{{nav_info['ret_cum_6m']}}
</td>
<td>
{{nav_info['ret_cum_1y']}}
</td>
<td>
{{nav_info['ret_cum_ytd']}}
</td>
<td>
{{nav_info['ret_cum_incep']}}
</td>
<td>
{{nav_info['distribution']}}
</td>
</tr>
{% endfor %}
</table>
</div>
<!-- 贡献分解 -->
<div
class=
"page dtable"
style=
"page-break-before:always;"
>
<div
class=
"page_title dcell"
>
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
</div>
<div
class=
"dcell"
>
<div
class=
"page_text"
>
{{brand_name}}
</div>
</div>
</div>
</div>
<div
class=
"tss2"
>
<div
class=
"tss2_title"
>
贡献分解
</div>
<div
class=
"tss2_content"
>
<img
src=
{{group_result["contribution_decomposition"]}}
alt=
""
class=
"tss2_img"
>
</div>
</div>
</div>
</div>
<div
class=
"box_line"
></div>
<!-- 个基点评 -->
<div
class=
"box5"
>
<div
class=
"page dtable"
>
<div
class=
"page_title dcell"
>
个基点评
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
</div>
<div
class=
"dcell"
>
<div
class=
"page_text"
>
{{brand_name}}
</div>
</div>
</div>
</div>
<div
class=
"box5_content"
>
<div
class=
"geji_list_wrap"
>
{% for i in range(group_result["single_fund_data_list"]|length) %}
{% if (i+1) % 3 == 1 and i != 0%}
<div
class=
"page dtable"
>
<div
class=
"page_title dcell"
>
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
</div>
<div
class=
"dcell"
>
<div
class=
"page_text"
>
{{brand_name}}
</div>
</div>
</div>
</div>
{% endif %}
{% if (i+1) % 3 == 0 and i != 0%}
<div
class=
"self_item"
style=
"page-break-after:always;"
>
{% else %}
<div
class=
"self_item"
>
{% endif %}
<table>
<tr>
<td
style=
"padding: 0;text-align: left;vertical-align: middle;"
>
<div
class=
"self_item_left"
>
<div
class=
"self_header clearfix"
>
<div
class=
"self_title fl"
>
{{group_result["single_fund_data_list"][i].fund_name}}
</div>
{{group_result["single_fund_data_list"][i].status}}
</div>
<div
class=
"self_description"
>
{% for one in group_result["single_fund_data_list"][i].evaluation %}
<div
class=
"self_description_item"
>
<div
class=
"self_description_dot"
></div>
<div
class=
"self_description_text"
>
{{one}}
</div>
</div>
{% endfor %}
</div>
</div>
</td>
<td
style=
"padding: 0;text-align: left;vertical-align: middle;"
>
<div
class=
"self_item_right"
>
<img
src=
{{group_result["single_fund_data_list"][i].radar_chart_path}}
alt=
""
class=
"self_img"
>
</div>
</td>
</tr>
</table>
</div>
{% endfor %}
</div>
<!-- 持仓点评 -->
{% if single_fund_data_list|length % 3 == 0 and single_fund_data_list|length != 0%}
<div
class=
"page dtable"
>
<div
class=
"page_title dcell"
>
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
</div>
<div
class=
"dcell"
>
<div
class=
"page_text"
>
{{brand_name}}
</div>
</div>
</div>
</div>
{% endif %}
<div
class=
"target_comment"
>
<div
class=
"comment_title"
>
持仓点评
<div
class=
"comment_tri"
></div>
</div>
<div
class=
"comment_content"
>
{% for eval in group_result["old_evaluation"] %}
<div
class=
"comment_item"
>
<div
class=
"comment_dot"
></div>
<div
class=
"comment_text"
>
{{eval}}
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
<div
class=
"box_line"
></div>
<!-- 优化组合建议 -->
<div
class=
"box6"
>
<div
class=
"page dtable"
>
<div
class=
"page_title dcell"
>
优化组合建议
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
</div>
<div
class=
"dcell"
>
<div
class=
"page_text"
>
{{brand_name}}
</div>
</div>
</div>
</div>
<div
class=
"box6_content"
>
<!-- 调仓建议 -->
<div
class=
"tss3"
style=
"margin: 0;"
>
<div
class=
"tss3_head dtable"
>
<div
class=
"tss3_title dcell"
>
调仓建议
</div>
</div>
<table
border=
"1"
>
<tr>
<th>
投资策略
</th>
<th>
基金简称
</th>
<th>
优化前(万元)
</th>
<th>
优化后(万元)
</th>
</tr>
{% for key, value in group_result["suggestions_result"].items() %}
{% for i in range(value|length) %}
<tr>
{% if i == 0%}
<td
rowspan=
{{value|length
}}
>
{{key}}
</td>
{% endif %}
<td>
{{value[i]["fund_name"]}}
</td>
<td
class=
"font_red"
>
{{value[i]["before_optimization"]}}
</td>
<td
class=
"font_green"
>
{{value[i]["after_optimization"]}}
</td>
</tr>
{% endfor %}
{% endfor %}
<tr>
<td
colspan=
"2"
class=
"gray"
>
总市值(万元)
</td>
<td
class=
"summary"
>
{{group_result["suggestions_result_asset"]["before"]}}
</td>
<td
class=
"summary"
>
{{group_result["suggestions_result_asset"]["after"]}}
</td>
</tr>
</table>
</div>
<!-- 指标对比 -->
<div
class=
"tss3"
>
<div
class=
"tss3_head dtable"
>
<div
class=
"tss3_title dcell"
>
指标对比
<span
class=
"tss3_start_time"
>
(起始日期2019-11-06)
</span>
</div>
<div
class=
"tss3_now_time dcell"
>
截止日:最新净值日({{latest_worth_day}})
</div>
</div>
<table
border=
"1"
>
<tr>
<th>
类型
</th>
<th>
区间收益(%)
</th>
<th>
年化收益(%)
</th>
<th>
波动率(%)
</th>
<th>
最大回撤(%)
</th>
<th>
夏普比率
</th>
</tr>
{%for i in range(group_result["indicator_compare"]|length)%}
{%if i
<
(
group_result
["
indicator_compare
"]|
length
)
-1
%}
{%
if
i
%
2=
=0
%}
<
tr
>
{%endif%}
{%if i%2==1 %}
<tr
class=
"yellow"
>
{%endif%}
{%endif%}
<td>
{{group_result["indicator_compare"][i]["group_name"]}}
</td>
<td>
{{group_result["indicator_compare"][i]["return_ratio"]}}
</td>
<td>
{{group_result["indicator_compare"][i]["return_ratio_year"]}}
</td>
<td>
{{group_result["indicator_compare"][i]["volatility"]}}
</td>
<td>
{{group_result["indicator_compare"][i]["max_drawdown"]}}
</td>
<td>
{{group_result["indicator_compare"][i]["sharpe"]}}
</td>
</tr>
{% endfor %}
</table>
<div
class=
"tss3_tip"
>
注:以上指标自持仓首日开始计算,结果仅供参考,如果持仓时间过短会造成指标失真的情况。
</div>
</div>
<!-- 收益比较、相关性分析 -->
<div
class=
"page dtable"
style=
"page-break-before:always;"
>
<div
class=
"page_title dcell"
>
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
</div>
<div
class=
"dcell"
>
<div
class=
"page_text"
>
{{brand_name}}
</div>
</div>
</div>
</div>
<div
class=
"par clearfix"
cellpadding=
"38"
>
<div
class=
"par_item fl"
>
<div
class=
"par_title"
>
收益比较
</div>
<div
class=
"par_content"
>
<img
src=
{{group_result["return_compare_pic"]}}
alt=
""
class=
"par_img"
>
</div>
</div>
<div
class=
"par_item fr"
>
<div
class=
"par_title"
>
相关性分析
</div>
<div
class=
"par_content relative_chart"
>
<div
class=
"rc_chart clearfix"
>
<div
class=
"rcc_left fl"
>
<table
border=
"1"
style=
"border-color: transparent;margin-right: 20px;"
>
{% for correlation in group_result["new_correlation"] %}
<tr>
<td>
<span
class=
"rcc_index"
>
{{correlation[0]}}
</span>
</td>
</tr>
{% endfor %}
</table>
</div>
<div
class=
"rcc_right fr"
>
<table
border=
"1"
>
{% for correlation in group_result["new_correlation"] %}
<tr>
{% for i in range(correlation[2]|length) %}
{% if i == correlation[0] - 1 %}
<td>
<span
class=
"rcc_index"
>
{{correlation[0]}}
</span>
</td>
{% elif -1
<
=
correlation
[
2
][
i
]
<
-0
.
5
and
i
<
correlation
[
0
]
-
1
%}
<
td
>
{{correlation[2][i]}}
</td>
{% elif -1
<
=
correlation
[
2
][
i
]
<
-0
.
5
%}
<
td
class=
"level_color6"
>
{{correlation[2][i]}}
</td>
{% elif -0.5
<
=
correlation
[
2
][
i
]
<
-0
.
25
and
i
<
correlation
[
0
]
-
1
%}
<
td
>
{{correlation[2][i]}}
</td>
{% elif -0.5
<
=
correlation
[
2
][
i
]
<
-0
.
25
%}
<
td
class=
"level_color5"
>
{{correlation[2][i]}}
</td>
{% elif -0.25
<
=
correlation
[
2
][
i
]
<
0
and
i
<
correlation
[
0
]
-
1
%}
<
td
>
{{correlation[2][i]}}
</td>
{% elif -0.25
<
=
correlation
[
2
][
i
]
<
0
%}
<
td
class=
"level_color4"
>
{{correlation[2][i]}}
</td>
{% elif 0
<
=
correlation
[
2
][
i
]
<
0
.
25
and
i
<
correlation
[
0
]
-
1
%}
<
td
>
{{correlation[2][i]}}
</td>
{% elif 0
<
=
correlation
[
2
][
i
]
<
0
.
25
%}
<
td
class=
"level_color3"
>
{{correlation[2][i]}}
</td>
{% elif 0.25
<
=
correlation
[
2
][
i
]
<
0
.
5
and
i
<
correlation
[
0
]
-
1
%}
<
td
>
{{correlation[2][i]}}
</td>
{% elif 0.25
<
=
correlation
[
2
][
i
]
<
0
.
5
%}
<
td
class=
"level_color2"
>
{{correlation[2][i]}}
</td>
{% elif 0.5
<
=
correlation
[
2
][
i
]
<=
1
and
i
<
correlation
[
0
]
-
1
%}
<
td
>
{{correlation[2][i]}}
</td>
{% elif 0.5
<
=
correlation
[
2
][
i
]
<=
1
%}
<
td
class=
"level_color1"
>
{{correlation[2][i]}}
</td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</table>
</div>
</div>
<div
class=
"rc_tooltip"
>
<div
class=
"rct_color clearfix"
>
<div
class=
"rct_color_item fl level_color1"
></div>
<div
class=
"rct_color_item fl level_color2"
></div>
<div
class=
"rct_color_item fl level_color3"
></div>
<div
class=
"rct_color_item fl level_color4"
></div>
<div
class=
"rct_color_item fl level_color5"
></div>
<div
class=
"rct_color_item fl level_color6"
></div>
</div>
</div>
<div
class=
"rc_tooltip"
style=
"margin: 0;"
>
<div
class=
"rct_number clearfix"
>
<div
class=
"rtc_number_item fl"
>
1.00
</div>
<div
class=
"rtc_number_item fl"
>
0.50
</div>
<div
class=
"rtc_number_item fl"
>
0.25
</div>
<div
class=
"rtc_number_item fl"
>
0.00
</div>
<div
class=
"rtc_number_item fl"
>
-0.25
</div>
<div
class=
"rtc_number_item fl"
>
-0.50
</div>
<div
class=
"rtc_number_item fl"
>
-1.00
</div>
</div>
</div>
<div
class=
"rc_label clearfix"
>
{% for correlation in group_result["new_correlation"] %}
<div
class=
"rcl_item fl"
>
<div
class=
"rcl_item_number"
>
{{correlation[0]}}
</div>
<div
class=
"rcl_item_name"
>
{{correlation[1]}}
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"box_line"
></div>
<!-- 新增基金 -->
<div
class=
"box7"
>
<div
class=
"page dtable"
>
<div
class=
"page_title dcell"
>
新增基金
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
</div>
<div
class=
"dcell"
>
<div
class=
"page_text"
>
{{brand_name}}
</div>
</div>
</div>
</div>
<div
class=
"box7_content"
>
<div
class=
"geji_list_wrap"
>
{% for i in range(group_result["propose_fund_data_list"]|length) %}
{% if (i+1) % 3 == 1 and i != 0%}
<div
class=
"page dtable"
style=
"page-break-before:always;"
>
<div
class=
"page_title dcell"
>
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
</div>
<div
class=
"dcell"
>
<div
class=
"page_text"
>
{{brand_name}}
</div>
</div>
</div>
</div>
<div
class=
"self_item"
>
{% else %}
<div
class=
"self_item"
>
{% endif %}
<table>
<tr>
<td
style=
"padding: 0;text-align: left;vertical-align: middle;"
>
<div
class=
"self_item_left"
>
<div
class=
"self_header clearfix"
>
<div
class=
"self_title fl"
>
{{group_result["propose_fund_data_list"][i].fund_name}}
</div>
</div>
<div
class=
"self_description"
>
{% for one in group_result["propose_fund_data_list"][i].evaluation %}
<div
class=
"self_description_item"
>
<div
class=
"self_description_dot"
></div>
<div
class=
"self_description_text"
>
{{one}}
</div>
</div>
{% endfor %}
</div>
</div>
</td>
<td
style=
"padding: 0;text-align: left;vertical-align: middle;"
>
<div
class=
"self_item_right"
>
<img
src=
{{group_result["propose_fund_data_list"][i].radar_chart_path}}
alt=
""
class=
"self_img"
>
</div>
</td>
</tr>
</table>
</div>
{% endfor %}
</div>
<!-- 持仓点评 -->
<div
class=
"target_comment"
>
<div
class=
"comment_title"
>
优化方案点评
<div
class=
"comment_tri"
></div>
</div>
<div
class=
"comment_content"
>
<div
class=
"comment_item"
>
<div
class=
"comment_dot"
></div>
<div
class=
"comment_text"
>
{{group_result["new_group_evaluation"]}}
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"box_line"
></div>
{%endfor%}
<!-- 结尾 -->
<div
class=
"box8"
>
<div
class=
"page dtable"
>
<div
class=
"page_title dcell"
>
</div>
<div
class=
"page_head dcell"
>
<div
class=
"dcell"
>
<img
src=
{{logo}}
alt=
""
class=
"page_logo"
>
</div>
<div
class=
"dcell"
>
<div
class=
"page_line"
></div>
</div>
<div
class=
"dcell"
>
<div
class=
"page_text"
>
{{brand_name}}
</div>
</div>
</div>
</div>
<div
class=
"box8_content"
>
<div
class=
"financial_show dtable"
>
<div
class=
"financial_left dcell"
>
<div
class=
"financial_scene"
>
<img
src=
{{scene}}
alt=
""
class=
"financial_scene_img"
>
<div
class=
"financial_scene_text"
>
我们挣的是⻆度和变化的钱⽽不是纠正市场错 误的钱,市场永远是正确的,关键是在其正确 被反复证明后的逆向⽽⾏,⼀定是避开它的正 确被展开的过程 。
</div>
<div
class=
"financial_scene_author"
>
——飞度
</div>
</div>
</div>
<div
class=
"financial_show_right dcell"
>
<div
class=
"financial_team"
>
<img
src=
{{team}}
alt=
""
class=
"financial_team_img"
>
</div>
</div>
</div>
<div
class=
"statement_content"
>
<div
class=
"statement_block"
>
<div
class=
"statement_title"
>
探普研究院声明
</div>
<div
class=
"statement_p"
>
本诊断报告所表述的任何观点均准确地反应了研究人员的看法;该研究人员所得报酬的任何组成部分无论是过去、现在、或者将来均不会直接或间接地与研究报告所表述的建议或观点相联系。
</div>
</div>
<div
class=
"statement_block"
>
<div
class=
"statement_title"
>
一般性声明
</div>
<div
class=
"statement_p"
>
本报告对于收件人而言属于高度机密,只有收件人才能使用。本报告并非意图发送、发布给在
当地法律或监管规则下不允许向其发送、发布该研究报告的人员。本研究报告仅供参考之用,在任何地区均不应被视为买卖任何证券、金融工具、基金、以及其他理财产品的要约或要约邀请。探普研究院并不因收件人收到本报告而视其为客户。本报告所包含的观点及建议并未考虑个别客户的特殊状况、目标或需要,不应视为对特定客户关于特定证券或金融工具、基金、以及其他理财产品的购买建议或策略。对于本报告中提及的任何证券、金融工具、基金、以及其他理财产品,本报告的
收件人须保持自身的独立判断。
</div>
<div
class=
"statement_p"
>
本报告所载资料的来源被认为是可靠的,但探普研究院不保证其准确性或完整性,并不对使用本报告所包含的材料产生任何直接或间接损失或与此有关的其他损失承担任何责任。本报告提及的任何证券、金融工具、基金或其他理财产品均可能含有巨大的风险,可能不易变卖以及不适合所有的投资者。本报告所提及的证券、金融工具、基金或其他理财产品的价格、价值以及收益可能会受
汇率影响而波动。过往的业绩也不能代表未来的表现。
</div>
<div
class=
"statement_p"
>
本报告所载的资料、观点以及预测分析均反映了探普研究院在最初报告发布日期当日的判断,可以在不发出通知的情况下做出更改、亦可因使用不同假设和标准、采用不同观点和分析方法而与市场上其他机构、部门、单位、个人在制作类似的其他材料时所给出的意见不同或者相反。探普研究院以及关联公司、单位并不承担提示本报告收件人注意该等材料的责任。负责撰写本报告研究人员薪酬并不基于任何金融产品的销售情况而定,但其薪酬可能会与我司的整体收入有关。
</div>
<div
class=
"statement_p"
>
若以探普研究院以外的机构或个人发送本报告,则由该机构或个人为此发送行为承担全部责任。该机构或个人应联系相关机构以交易本报告中提及的证券、金融工具、基金、其他理财产品获悉更详细信息。本报告不构成探普研究院向发送本报告的机构或个人的客户提供的投资建议,探普研究院以及关联单位、公司中的各个高级职员、董事、员工亦不为(前述机构或个人)因使用本报告或报告载明的内容产生的直接或间接损失承担任何责任。
</div>
</div>
<div
class=
"statement_block"
>
<div
class=
"statement_title2"
>
未经探普研究院事先书面授权,任何人不得以任何目的复制、发送或者销售本报告。探普研究院 2020 版权所有,保留一切权利。
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
app/utils/jinjia2html_v2.py
0 → 100644
View file @
e027a0cb
import
time
import
uuid
from
jinja2
import
PackageLoader
,
Environment
from
app.api.engine
import
work_dir
,
pdf_folder
,
template_folder
from
app.service.portfolio_diagnose
import
PortfolioDiagnose
from
app.service.result_service_v2
import
UserCustomerResultAdaptor
import
numpy
as
np
from
concurrent
import
futures
import
os
# 准备数据
from
app.utils.draw
import
draw_month_return_chart
,
draw_contribution_chart
,
draw_combination_chart
,
\
draw_old_combination_chart
from
app.utils.html_to_pdf
import
html_to_pdf
from
app.utils.radar_chart
import
gen_radar_chart
class
DataIntegrate
:
def
__init__
(
self
,
ifa_id
=
'USER_INFO15914346866762'
,
customer_id
=
'202009281545001'
,
pdf_name
=
str
(
uuid
.
uuid4
())
+
'.pdf'
):
self
.
user_customer
=
UserCustomerResultAdaptor
(
ifa_id
,
customer_id
)
self
.
customer_name
=
self
.
user_customer
.
customer_real_name
self
.
pdf_name
=
pdf_name
# 全部数据
self
.
df
=
self
.
user_customer
.
calculate_total_data
()
# 组合结果数据
self
.
d
=
self
.
user_customer
.
calculate_group_result_data
()
self
.
all_folio_result
=
{}
# 分组合拼接结果数据
self
.
get_group_result
()
# # 组合数据
# self.group_result = self.d["default"]
# self.get_portfolio_diagnose(self.group_result["fund_id_list"])
# 投资总览
self
.
get_summarize
()
# 月度回报
self
.
get_month_return
()
# 月度回报表格
self
.
get_month_table_return
()
# 渲染模版
self
.
render_data
()
# 分组和计算个基点评以及新增基金等结果
def
get_group_result
(
self
):
for
group_name
,
group_result
in
self
.
d
.
items
():
portfolio_diagnose
=
self
.
get_portfolio_diagnose
(
group_result
[
"fund_id_list"
],
invest_amount
=
group_result
[
"total_cost"
])
cur_group_portfolio_result
=
{}
# 旧持仓组合点评
self
.
comments_on_position_portfolio
(
portfolio_diagnose
,
group_name
,
cur_group_portfolio_result
)
# 贡献分解
self
.
contribution_deco
(
group_result
,
cur_group_portfolio_result
)
# 目标与业绩
self
.
objectives_performance
(
group_result
,
cur_group_portfolio_result
)
# 个基点评
self
.
single_fund_comment
(
portfolio_diagnose
,
cur_group_portfolio_result
)
# 旧收益比较
self
.
get_old_compare_pic
(
cur_group_portfolio_result
)
# 旧相关性
self
.
get_old_correlation
(
portfolio_diagnose
,
cur_group_portfolio_result
)
# # 新增基金
self
.
propose_fund
(
portfolio_diagnose
,
cur_group_portfolio_result
)
# # 新收益比较
self
.
get_transfer_suggestions
(
portfolio_diagnose
,
group_name
,
cur_group_portfolio_result
)
# # 新相关性
self
.
get_new_correlation
(
portfolio_diagnose
,
cur_group_portfolio_result
)
self
.
all_folio_result
[
group_name
]
=
cur_group_portfolio_result
def
get_portfolio_diagnose
(
self
,
portfolio
,
client_type
=
1
,
invest_amount
=
10000000
):
portfolio_diagnose
=
PortfolioDiagnose
(
client_type
=
client_type
,
portfolio
=
portfolio
,
invest_amount
=
invest_amount
)
portfolio_diagnose
.
optimize
()
return
portfolio_diagnose
# 全部数据综述结果
def
get_summarize
(
self
):
"""投资总览."""
self
.
total_cost
=
round
(
self
.
df
[
"total_cost"
],
2
)
# 投资成本
self
.
now_yield
=
round
((
self
.
df
[
'cumulative_return'
]
-
1
)
*
100
,
2
)
# 成立以来累计收益率
self
.
now_annualised_return
=
round
(
self
.
df
[
"return_ratio_year"
]
*
100
,
2
)
# 年化收益率
self
.
index_yield
=
round
((
self
.
df
[
"index_result"
][
"return_ratio"
]
-
1
)
*
100
,
2
)
# 指数收益率
self
.
now_withdrawal
=
round
(
self
.
df
[
"max_drawdown"
][
0
]
*
100
,
2
)
# 最大回撤
self
.
index_withdrawal
=
round
(
self
.
df
[
"index_result"
][
"max_drawdown"
][
0
]
*
100
,
2
)
# 指数最大回撤
self
.
now_month_income
=
int
(
self
.
df
[
"cur_month_profit"
])
# 本月收益
self
.
month_rise
=
round
(
self
.
df
[
"cur_month_profit_ratio"
]
*
100
,
2
)
# 本月涨幅
self
.
year_totoal_rate_of_return
=
round
(
self
.
df
[
"cur_year_profit_ratio"
]
*
100
,
2
)
# 今年累计收益率
self
.
now_year_income
=
int
(
self
.
df
[
"cur_year_profit"
])
# 今年累计收益
self
.
final_balance
=
int
(
self
.
df
[
"total_cost"
]
+
self
.
df
[
"cumulative_profit"
])
# 期末资产
self
.
total_profit
=
int
(
self
.
df
[
"cumulative_profit"
])
# 累计盈利
def
get_month_return
(
self
):
"""月度回报."""
"""组合月度及累计回报率曲线图"""
xlabels
,
product_list
,
cumulative
=
self
.
user_customer
.
get_month_return_chart
()
self
.
monthly_return_performance_pic
=
draw_month_return_chart
(
xlabels
,
product_list
,
cumulative
)
def
get_month_table_return
(
self
):
"""月度盈亏和期末资产"""
self
.
monthly_table_return
=
self
.
df
[
"month_return_data_dict"
]
# 旧组合持仓点评,贡献分解数据
def
comments_on_position_portfolio
(
self
,
portfolio_diagnose
,
folio
,
cur_group_portfolio_result
):
"""旧持仓组合点评. 旧贡献分解数据"""
cur_group_portfolio_result
[
"old_evaluation"
],
cur_group_portfolio_result
[
"old_return_compare_data"
],
\
cur_group_portfolio_result
[
"old_indicator_compare"
]
=
portfolio_diagnose
.
old_evaluation
(
folio
,
self
.
d
,
self
.
user_customer
)
def
contribution_deco
(
self
,
group_result
,
cur_group_portfolio_result
):
"""贡献分解."""
g_data
=
group_result
[
"contribution_decomposition"
]
cur_group_portfolio_result
[
"contribution_decomposition"
]
=
draw_contribution_chart
(
g_data
[
'xlabels'
],
g_data
[
'product_list'
],
g_data
[
'cumulative'
])
def
single_fund_comment
(
self
,
portfolio_diagnose
,
cur_group_portfolio_result
):
"""个基点评."""
single_fund_data_list
=
[]
portfolio_evaluation
=
portfolio_diagnose
.
old_portfolio_evaluation
()
radar_chart_data
=
portfolio_diagnose
.
single_fund_radar
()
with
futures
.
ProcessPoolExecutor
(
os
.
cpu_count
())
as
executor
:
res
=
executor
.
map
(
gen_radar_chart
,
radar_chart_data
)
res
=
list
(
res
)
for
i
in
range
(
len
(
portfolio_evaluation
)):
if
portfolio_evaluation
[
i
][
'status'
]
==
'保留'
:
portfolio_evaluation
[
i
][
'status'
]
=
'<div class="self_type fl">保留</div>'
elif
portfolio_evaluation
[
i
][
'status'
]
==
'增仓'
:
portfolio_evaluation
[
i
][
'status'
]
=
'<div class="self_type fl red">增仓</div>'
elif
portfolio_evaluation
[
i
][
'status'
]
==
'换仓'
:
portfolio_evaluation
[
i
][
'status'
]
=
'<div class="self_type fl green">换仓</div>'
elif
portfolio_evaluation
[
i
][
'status'
]
==
'减仓'
:
portfolio_evaluation
[
i
][
'status'
]
=
'<div class="self_type fl green">减仓</div>'
single_fund_data_list
.
append
({
'fund_name'
:
portfolio_evaluation
[
i
][
'name'
],
'status'
:
portfolio_evaluation
[
i
][
'status'
],
'evaluation'
:
portfolio_evaluation
[
i
][
'data'
],
'radar_chart_path'
:
res
[
i
]
})
cur_group_portfolio_result
[
"single_fund_data_list"
]
=
single_fund_data_list
def
get_old_compare_pic
(
self
,
cur_group_portfolio_result
):
"""旧收益比较"""
cur_group_portfolio_result
[
"old_return_compare_pic"
]
=
draw_old_combination_chart
(
cur_group_portfolio_result
[
"old_return_compare_data"
][
"xlabels"
],
cur_group_portfolio_result
[
"old_return_compare_data"
][
"origin_combination"
],
cur_group_portfolio_result
[
"old_return_compare_data"
][
"index"
])
def
get_transfer_suggestions
(
self
,
portfolio_diagnose
,
folio
,
cur_group_portfolio_result
):
"""新收益比较,调仓建议"""
cur_group_portfolio_result
[
"suggestions_result"
],
cur_group_portfolio_result
[
"suggestions_result_asset"
],
\
cur_group_portfolio_result
[
"return_compare_data"
],
\
cur_group_portfolio_result
[
"indicator_compare"
],
cur_group_portfolio_result
[
"new_group_evaluation"
]
=
portfolio_diagnose
.
new_evaluation
(
folio
,
self
.
d
,
self
.
user_customer
)
cur_group_portfolio_result
[
"return_compare_pic"
]
=
draw_combination_chart
(
cur_group_portfolio_result
[
"return_compare_data"
][
"xlabels"
],
cur_group_portfolio_result
[
"return_compare_data"
][
"new_combination"
],
cur_group_portfolio_result
[
"return_compare_data"
][
"origin_combination"
],
cur_group_portfolio_result
[
"return_compare_data"
][
"index"
])
def
get_old_correlation
(
self
,
portfolio_diagnose
,
cur_group_portfolio_result
):
"""旧相关性分析."""
old_correlation
=
portfolio_diagnose
.
old_correlation
old_correlation_columns
=
old_correlation
.
columns
.
tolist
()
old_correlation_values
=
old_correlation
.
values
.
tolist
()
cur_group_portfolio_result
[
"old_correlation"
]
=
list
(
zip
(
range
(
1
,
len
(
old_correlation_columns
)
+
1
),
old_correlation_columns
,
old_correlation_values
))
def
get_new_correlation
(
self
,
portfolio_diagnose
,
cur_group_portfolio_result
):
"""新相关性分析."""
new_correlation
=
portfolio_diagnose
.
new_correlation
new_correlation_columns
=
new_correlation
.
columns
.
tolist
()
new_correlation_values
=
new_correlation
.
values
.
tolist
()
cur_group_portfolio_result
[
"new_correlation"
]
=
list
(
zip
(
range
(
1
,
len
(
new_correlation_columns
)
+
1
),
new_correlation_columns
,
new_correlation_values
))
def
propose_fund
(
self
,
portfolio_diagnose
,
cur_group_portfolio_result
):
"""新增基金"""
# 优化组合建议1 -- 新增基金
propose_fund_data_list
=
[]
propose_fund_evaluation
=
portfolio_diagnose
.
propose_fund_evaluation
()
propose_radar_chart_data
=
portfolio_diagnose
.
propose_fund_radar
()
with
futures
.
ProcessPoolExecutor
(
os
.
cpu_count
())
as
executor
:
res
=
executor
.
map
(
gen_radar_chart
,
propose_radar_chart_data
)
res
=
list
(
res
)
for
i
in
range
(
len
(
propose_fund_evaluation
)):
propose_fund_data_list
.
append
({
'fund_name'
:
propose_fund_evaluation
[
i
][
'name'
],
'status'
:
'增仓'
,
'evaluation'
:
propose_fund_evaluation
[
i
][
'data'
],
'radar_chart_path'
:
res
[
i
]
})
cur_group_portfolio_result
[
"propose_fund_data_list"
]
=
propose_fund_data_list
def
objectives_performance
(
self
,
group_result
,
cur_group_portfolio_result
):
"""目标与业绩"""
cur_group_portfolio_result
[
"totoal_rate_of_return"
]
=
round
((
group_result
[
'cumulative_return'
]
-
1
)
*
100
,
2
)
# 成立以来累计收益率
cur_group_portfolio_result
[
"annualised_return"
]
=
round
(
group_result
[
"return_ratio_year"
]
*
100
,
2
)
# 年化收益率
cur_group_portfolio_result
[
"volatility"
]
=
round
(
group_result
[
"volatility"
]
*
100
,
2
)
cur_group_portfolio_result
[
"max_withdrawal"
]
=
round
(
group_result
[
"max_drawdown"
][
0
]
*
100
,
2
)
cur_group_portfolio_result
[
"sharpe_ratio"
]
=
round
(
group_result
[
"sharpe"
],
2
)
cur_group_portfolio_result
[
"cost_of_investment"
]
=
round
(
group_result
[
"total_cost"
]
/
10000.0
,
2
)
# 投资成本
cur_group_portfolio_result
[
"index_section_return"
]
=
round
((
group_result
[
"index_result"
][
"return_ratio"
]
-
1
)
*
100
,
2
)
cur_group_portfolio_result
[
"index_annualised_return"
]
=
round
(
group_result
[
"index_result"
][
"return_ratio_year"
]
*
100
,
2
)
# 年化收益率
cur_group_portfolio_result
[
"index_volatility"
]
=
round
(
group_result
[
"index_result"
][
"volatility"
]
*
100
,
2
)
cur_group_portfolio_result
[
"index_max_withdrawal"
]
=
round
(
group_result
[
"index_result"
][
"max_drawdown"
][
0
]
*
100
,
2
)
cur_group_portfolio_result
[
"index_sharpe_ratio"
]
=
round
(
group_result
[
"index_result"
][
"sharpe"
],
2
)
cur_group_portfolio_result
[
"group_nav_info"
]
=
group_result
[
"group_nav_info"
]
cur_group_portfolio_result
[
"group_hoding_info"
]
=
group_result
[
"group_hoding_info"
]
cur_group_portfolio_result
[
"group_hoding_info_total"
]
=
group_result
[
"group_hoding_info_total"
]
def
render_data
(
self
):
# 全部数据
data
=
{
# 封面 值为None不不显示,为block显示
'box0'
:
'block'
,
# 目录
'box1'
:
'block'
,
# 投资总览
'box2'
:
'block'
,
# 目标与业绩
'box3'
:
'block'
,
# 业绩的明细
'box4'
:
'block'
,
# 个基点评
'box5'
:
'block'
,
# 优化组合建议
'box6'
:
None
,
# 新增基金
'box7'
:
None
,
# 结尾
'box8'
:
'block'
,
'cover_back'
:
template_folder
+
'/v2/img/cover-back.png'
,
'logo'
:
template_folder
+
'/v2/img/logo.png'
,
'scene'
:
template_folder
+
'/v2/img/scene.png'
,
'team'
:
template_folder
+
'/v2/img/team.png'
,
# 全局数据
'customer_name'
:
self
.
customer_name
,
'year_month'
:
self
.
user_customer
.
month_start_date
.
strftime
(
"
%
Y-
%
m"
),
'month'
:
self
.
user_customer
.
month_start_date
.
strftime
(
"
%
m"
),
'start_date'
:
self
.
user_customer
.
start_date
.
strftime
(
"
%
Y-
%
m-
%
d"
),
'latest_worth_day'
:
self
.
user_customer
.
last_nav_date
,
'brand_name'
:
'小飞象<br>工作室'
,
'customer_old'
:
42
,
'customer_level'
:
'平衡型'
,
# 综述数据
'now_allocation_amount'
:
self
.
total_cost
,
'now_yield'
:
self
.
now_yield
,
'index_yield'
:
self
.
index_yield
,
'now_annualised_return'
:
self
.
now_annualised_return
,
'now_withdrawal'
:
self
.
now_withdrawal
,
'index_withdrawal'
:
self
.
index_withdrawal
,
'expected_withdrawal'
:
20
,
'now_year_income'
:
self
.
now_year_income
,
'now_month_income'
:
self
.
now_month_income
,
'final_balance'
:
self
.
final_balance
,
'total_profit'
:
self
.
total_profit
,
'monthly_return_performance_pic'
:
self
.
monthly_return_performance_pic
,
'month_rise'
:
self
.
month_rise
,
'year_totoal_rate_of_return'
:
self
.
year_totoal_rate_of_return
,
'monthly_table_return'
:
self
.
monthly_table_return
,
# 组合数据
'all_folio_result'
:
self
.
all_folio_result
,
# 'totoal_rate_of_return': self.totoal_rate_of_return,
# 'annualised_return': self.annualised_return, 'cost_of_investment': self.cost_of_investment,
#
#
# 'index_comparison': {'section_return': self.totoal_rate_of_return, 'annualized_returns': self.annualised_return,
# 'volatility': self.volatility, 'max_withdrawal': self.max_withdrawal,
# 'sharpe_ratio': self.sharpe_ratio},
# 'index_comparison_500': {'section_return': self.index_section_return,
# 'annualized_returns': self.index_annualised_return,
# 'volatility': self.index_volatility, 'max_withdrawal': self.index_max_withdrawal,
# 'sharpe_ratio': self.index_sharpe_ratio},
#
# 'group_nav_info': self.group_nav_info,
# 'group_hoding_info': self.group_hoding_info,
# 'group_hoding_info_total': self.group_hoding_info_total,
# 'old_evaluation': self.old_evaluation,
# 'old_indicator_compare': self.old_indicator_compare,
# 'contribution_decomposition': self.contribution_decomposition,
# 'single_fund_data_list': self.single_fund_data_list,
# 'old_correlation': self.old_correlation,
# 'old_return_compare_pic': self.old_return_compare_pic,
# # 'new_correlation': self.new_correlation,
# # 'propose_fund_data_list': self.propose_fund_data_list,
# # 'suggestions_result': self.suggestions_result,
# # 'suggestions_result_asset': self.suggestions_result_asset,
# # 'return_compare_pic': self.return_compare_pic,
# # 'indicator_compare': self.indicator_compare,
# # 'new_group_evaluation': self.new_group_evaluation
# 'new_correlation': [],
# 'propose_fund_data_list': [],
# 'suggestions_result': {},
# 'suggestions_result_asset': {},
# 'return_compare_pic': [],
# 'indicator_compare': [],
# 'new_group_evaluation': []
}
# 开始渲染html模板
env
=
Environment
(
loader
=
PackageLoader
(
'app'
,
'templates'
))
# 创建一个包加载器对象
# template = env.get_template('monthReport.html') # 获取一个模板文件
template
=
env
.
get_template
(
'/v2/monthReportV2.1.html'
)
# 获取一个模板文件
monthReport_html
=
template
.
render
(
data
)
# 渲染
# 保存 monthReport_html
# save_file = "app/html/monthReport.html"
# with open(save_file, 'w', encoding="utf-8") as f:
# f.write(monthReport_html)
# save_file = "app/html/v2/monthReportV2.html"
# with open(save_file, 'w', encoding="utf-8") as f:
# f.write(monthReport_html)
html_to_pdf
(
monthReport_html
,
pdf_folder
+
self
.
pdf_name
)
if
__name__
==
'__main__'
:
start
=
time
.
time
()
DataIntegrate
(
ifa_id
=
'USER_INFO15916072577875'
,
customer_id
=
'6716613804182482944'
)
print
(
'耗时{}秒'
.
format
(
round
(
time
.
time
()
-
start
,
2
)))
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