Commit 44af8cfc authored by jichao's avatar jichao

实盘完成待测试

parent 524994d7
......@@ -57,7 +57,7 @@ basic: # 基础信息模块
- 'FTEAUH1 LX Equity'
- 'TFIAAUS LX Equity'
navs: # 净值模块
exrate: # 汇率,如果不开启,个这块注释掉
exrate: # 汇率,如果不开启,个这块注释掉
- from: EUR # 需要转换的货币类型
ticker: EURUSD BGN Curncy # 汇率值的彭博ticker
asset-pool: # 资产池模块
......@@ -106,20 +106,17 @@ portfolios: # 投组模块
poem: # poem相关
cvar-scale-factor: 0.1 # 计算时用到的系数
right_side: # 这里表示右侧类型投组用到的参数,这里有则优先用这里的参数,如果没有,则用上面默认参数,参数含义和上面一致
asset-count: [3, 5]
navs:
risk: [1, 2]
exclude-asset-type: ['STOCK', 'BALANCED'] # 排除的资产类型
mpt:
quantile: 0.3
crisis_1: # 危机1相关,这里有则优先用这里的参数,如果没有,则用上面默认参数,参数含义和上面一致
asset-count: [3, 5]
navs:
risk: [1, 2]
mpt:
quantile: 0.1
crisis_2: # 危机2相关,这里有则优先用这里的参数,如果没有,则用上面默认参数,参数含义和上面一致
asset-count: [3, 5]
navs:
risk: [ 1, 2 ]
mpt:
......@@ -128,11 +125,11 @@ rebalance: # 再平衡模块
drift-solver: # drift解算器相关
date-curve: # 日期曲线drift相关
diff-threshold: 0.4 # 权重相差初始阀值
init-factor: 0.000000002 # 权相差递减因子
init-factor: 0.000000002 # 权相差递减因子
high-weight: # 高风险资产权重drift相关
coef: 0.2 # drift系数
ruler: # 再平衡信号选用规则
disable-period: # 禁止买入期
disable-period: # 禁止买入期,交易日
normal: 10 # 标准投组禁止买入期
crisis_1: 15 # 危机1投组禁止买入期
crisis_2: 15 # 危机2投组禁止买入期
......@@ -149,7 +146,7 @@ rebalance: # 再平衡模块
crisis-2: # 危机2相关
negative-growth: 1 # 实际利率负增长时长,单位年,点到点取值
fed-months: 3 # fed 滚动月份,点到点取值
fed-threshold: 0.75 # fed判断阀值
fed-threshold: -0.75 # fed判断阀值
right-side: # 市场右侧相关
rtn-days: 5 # 计算spx回报率滚动天数,交易日
min-threshold: -0.05 # spx回报率跌破阀值
......
......@@ -31,7 +31,7 @@ class CrisisSignal(BaseRebalanceSignal, ABC):
@property
def inversion_threshold(self):
return self._config['inversion-threshold'] if 'inversion-threshold' in self._config else 1
return self._config['inversion-threshold'] if 'inversion-threshold' in self._config else 0.3
def get_exp_start_date(self, day, risk: PortfoliosRisk):
assert day, "get crisis exp start date, day can not be none"
......@@ -118,5 +118,5 @@ class CrisisTwoSignal(CrisisSignal, BaseRebalanceSignal):
fed_today = self._navs.get_last_index_close(max_date=day, ticker='FDTR Index')
fed_before = self._navs.get_last_index_close(max_date=day - relativedelta(months=self.fed_months), ticker='FDTR Index')
return today <= before and fed_today['close'] - fed_before['close'] < -self.fed_threshold
return today <= before and fed_today['close'] - fed_before['close'] < self.fed_threshold
return False
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