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
612a1e7d
Commit
612a1e7d
authored
Dec 02, 2020
by
赵杰
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
# Conflicts: # app/service/portfolio_diagnose.py
parents
462fab91
a12f0fb3
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 @
612a1e7d
...
@@ -305,8 +305,6 @@ class BaseConvexOptimizer(BaseOptimizer):
...
@@ -305,8 +305,6 @@ class BaseConvexOptimizer(BaseOptimizer):
is_sector
=
[
sector_mapper
[
t
]
==
sector
for
t
in
self
.
tickers
]
is_sector
=
[
sector_mapper
[
t
]
==
sector
for
t
in
self
.
tickers
]
self
.
_constraints
.
append
(
cp
.
sum
(
self
.
_w
[
is_sector
])
>=
sector_lower
[
sector
])
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
):
def
convex_objective
(
self
,
custom_objective
,
weights_sum_to_one
=
True
,
**
kwargs
):
"""
"""
Optimise a custom convex objective function. Constraints should be added with
Optimise a custom convex objective function. Constraints should be added with
...
...
app/service/portfolio_diagnose.py
View file @
612a1e7d
This diff is collapsed.
Click to expand it.
app/utils/fund_rank.py
View file @
612a1e7d
# import pymysql
# import pymysql
from
sqlalchemy
import
create_engine
from
sqlalchemy
import
create_engine
db
=
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
()
con
=
db
.
connect
()
import
logging
import
logging
logging
.
basicConfig
(
level
=
logging
.
INFO
)
logging
.
basicConfig
(
level
=
logging
.
INFO
)
from
app.utils.week_evaluation
import
*
from
app.utils.week_evaluation
import
*
...
@@ -297,4 +301,4 @@ if __name__ == '__main__':
...
@@ -297,4 +301,4 @@ if __name__ == '__main__':
# fund_rank.to_csv("fund_rank.csv", encoding='gbk')
# fund_rank.to_csv("fund_rank.csv", encoding='gbk')
# df = pd.read_csv('fund_rank.csv')
# df = pd.read_csv('fund_rank.csv')
# df.to_sql("fund_rank", con, if_exists='replace')
# df.to_sql("fund_rank", con, if_exists='replace')
con
.
close
()
con
.
close
()
\ No newline at end of file
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