Commit 8144403e authored by brody's avatar brody

bugfix

parent 31e1830d
...@@ -310,7 +310,7 @@ class InvTrustPortfoliosHolder(DividendPortfoliosHolder): ...@@ -310,7 +310,7 @@ class InvTrustPortfoliosHolder(DividendPortfoliosHolder):
# 配息当天配股 # 配息当天配股
for k in share_nav.keys(): for k in share_nav.keys():
if k in fund_dividend: if k in fund_dividend:
share_nav[k] = (share_nav[k] * fund_dividend[k]) / (share_nav[k] * navs[k]) + share_nav[k] share_nav[k] = (share_nav[k] * fund_dividend[k]) /navs[k] + share_nav[k]
# 配息日当天取得调仓日计算的应调仓金额,做实际份额赎回,这里的金额(即月初计算的赎回金额)用于转换成“赎回目标的份额” # 配息日当天取得调仓日计算的应调仓金额,做实际份额赎回,这里的金额(即月初计算的赎回金额)用于转换成“赎回目标的份额”
need_div = last_nav['div_forecast'] need_div = last_nav['div_forecast']
if self.is_dividend_date(day) and need_div > 0: if self.is_dividend_date(day) and need_div > 0:
...@@ -323,7 +323,6 @@ class InvTrustPortfoliosHolder(DividendPortfoliosHolder): ...@@ -323,7 +323,6 @@ class InvTrustPortfoliosHolder(DividendPortfoliosHolder):
dividend_acc = dividend_acc + port_div + fund_dividend dividend_acc = dividend_acc + port_div + fund_dividend
fund_av = round(sum([navs[x] * y for x, y in share.items()]), 4) fund_av = round(sum([navs[x] * y for x, y in share.items()]), 4)
fund_nav = round(sum([navs[x] * y for x, y in share_nav.items()]), 4) fund_nav = round(sum([navs[x] * y for x, y in share_nav.items()]), 4)
fund_nav += fund_dividend
weight = {x: round(y * navs[x] / fund_av, 2) for x, y in share.items()} weight = {x: round(y * navs[x] / fund_av, 2) for x, y in share.items()}
weight_nav = {x: round(y * navs[x] / fund_av, 2) for x, y in share_nav.items()} weight_nav = {x: round(y * navs[x] / fund_av, 2) for x, y in share_nav.items()}
weight = format_weight(weight) weight = format_weight(weight)
......
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