Commit a12f0fb3 authored by 李宗熹's avatar 李宗熹

添加个基评价

parent 33df3fe6
...@@ -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
......
This diff is collapsed.
# 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment