Commit 1969887c authored by 李宗熹's avatar 李宗熹

'冲突'

parent 1cf3fd20
...@@ -3,7 +3,6 @@ from app.utils.risk_parity import * ...@@ -3,7 +3,6 @@ from app.utils.risk_parity import *
from app.pypfopt import risk_models from app.pypfopt import risk_models
from app.pypfopt import expected_returns from app.pypfopt import expected_returns
from app.pypfopt import EfficientFrontier from app.pypfopt import EfficientFrontier
from app.utils.week_evaluation import *
def cal_correlation(prod): def cal_correlation(prod):
...@@ -456,7 +455,7 @@ class PortfolioDiagnose(object): ...@@ -456,7 +455,7 @@ class PortfolioDiagnose(object):
# weights = ef.nonconvex_objective(deviation_risk_parity, ef.cov_matrix) # weights = ef.nonconvex_objective(deviation_risk_parity, ef.cov_matrix)
ef.efficient_return(0.3) ef.efficient_return(0.3)
clean_weights = ef.clean_weights() clean_weights = ef.clean_weights()
ef.portfolio_performance(verbose=True) # ef.portfolio_performance(verbose=True)
self.new_weights = np.array(list(clean_weights.values())) self.new_weights = np.array(list(clean_weights.values()))
print(clean_weights) print(clean_weights)
end4 = time.time() end4 = time.time()
...@@ -705,10 +704,10 @@ class PortfolioDiagnose(object): ...@@ -705,10 +704,10 @@ class PortfolioDiagnose(object):
else: else:
evaluation = choose_bad_evaluation(data) evaluation = choose_bad_evaluation(data)
ret = [] ret = ""
for k, v in evaluation.items(): for k, v in evaluation.items():
# print(translate_single(content[k], v)) # print(translate_single(content[k], v))
ret.append(sentence[k] % translate_single(content[k], v)) ret = ret + sentence[k] % translate_single(content[k], v)
fund_name = get_fund_name(fund_id).values[0][0] fund_name = get_fund_name(fund_id).values[0][0]
return {'name': fund_name, 'data': ret} return {'name': fund_name, 'data': ret}
......
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