Commit bbec713b authored by jichao's avatar jichao

回测报告增加基金池

parent 3bb0cc33
......@@ -21,8 +21,7 @@ class CurveDrift(BaseRebalanceSignal):
SignalType.CRISIS_ONE,
SignalType.CRISIS_TWO,
SignalType.MARKET_RIGHT,
SignalType.INIT,
SignalType.LOW_BUY
SignalType.INIT
]
def is_trigger(self, day, risk: PortfoliosRisk) -> bool:
......@@ -35,7 +34,7 @@ class CurveDrift(BaseRebalanceSignal):
normal_weight = round(sum([x[1] for x in normal_portfolio.items() if x[0] in datum_ids]), 2)
hold_portfolio = self._hold.get_portfolios_weight(day, risk)
hold_weight = round(sum([x[1] for x in hold_portfolio.items() if x[0] in datum_ids]), 2)
return normal_weight - hold_weight >= self._solver.get_drift(day, risk) # TODO 左边应该加绝对值
return normal_weight - hold_weight >= self._solver.get_drift(day, risk)
@property
def signal_type(self) -> SignalType:
......
......@@ -47,7 +47,7 @@ class HighBuySignal(BaseRebalanceSignal):
class LowBuySignal(HighBuySignal):
@property
def include_last_type(self): # TODO 回头看看要不要假如drift买入
def include_last_type(self):
return [
SignalType.CRISIS_ONE,
SignalType.CRISIS_TWO,
......
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