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
a12f0fb3
Commit
a12f0fb3
authored
Dec 02, 2020
by
李宗熹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加个基评价
parent
33df3fe6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
61 deletions
+94
-61
base_optimizer.py
app/pypfopt/base_optimizer.py
+0
-2
portfolio_diagnose.py
app/service/portfolio_diagnose.py
+87
-56
fund_rank.py
app/utils/fund_rank.py
+7
-3
No files found.
app/pypfopt/base_optimizer.py
View file @
a12f0fb3
...
...
@@ -305,8 +305,6 @@ class BaseConvexOptimizer(BaseOptimizer):
is_sector
=
[
sector_mapper
[
t
]
==
sector
for
t
in
self
.
tickers
]
self
.
_constraints
.
append
(
cp
.
sum
(
self
.
_w
[
is_sector
])
>=
sector_lower
[
sector
])
print
(
self
.
_constraints
)
def
convex_objective
(
self
,
custom_objective
,
weights_sum_to_one
=
True
,
**
kwargs
):
"""
Optimise a custom convex objective function. Constraints should be added with
...
...
app/service/portfolio_diagnose.py
View file @
a12f0fb3
This diff is collapsed.
Click to expand it.
app/utils/fund_rank.py
View file @
a12f0fb3
# import pymysql
from
sqlalchemy
import
create_engine
db
=
create_engine
(
'mysql+pymysql://tamp_fund:@imeng408@tamper.mysql.polardb.rds.aliyuncs.com:3306/tamp_fund?charset=utf8mb4'
)
'mysql+pymysql://tamp_fund:@imeng408@tamper.mysql.polardb.rds.aliyuncs.com:3306/tamp_fund?charset=utf8mb4'
,
pool_size
=
50
,
pool_recycle
=
3600
,
pool_pre_ping
=
True
)
con
=
db
.
connect
()
import
logging
logging
.
basicConfig
(
level
=
logging
.
INFO
)
logging
.
basicConfig
(
level
=
logging
.
INFO
)
from
app.utils.week_evaluation
import
*
...
...
@@ -297,4 +301,4 @@ if __name__ == '__main__':
# fund_rank.to_csv("fund_rank.csv", encoding='gbk')
# df = pd.read_csv('fund_rank.csv')
# df.to_sql("fund_rank", con, if_exists='replace')
con
.
close
()
\ No newline at end of file
con
.
close
()
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