Commit b884adf3 authored by wenwen.tang's avatar wenwen.tang 😕

回测nav的计算用复权净值

parent 64080a96
......@@ -279,9 +279,10 @@ class InvTrustPortfoliosHolder(DividendPortfoliosHolder):
funds = self._datum.get_datums(type=DatumType.FUND)
funds_subscription_rate = {fund['id']: fund.get('subscriptionRate', 0) for fund in funds}
share = {x: (1 - funds_subscription_rate[x]) * (fund_av * w) / navs[x] for x, w in weight.items()}
nav_cals = fund_div_tuple[2]
share_nav = share
# 不考虑配息
share_nodiv_nav = share
share_nodiv_nav = {x: (1 - funds_subscription_rate[x]) * (fund_av * w) / nav_cals[x] for x, w in weight.items()}
# 初始买入扣手续费
fee = sum(funds_subscription_rate[x] * (fund_av * w) for x, w in weight.items())
fund_av = fund_av - fee
......
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