Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
R
robo-dividend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenwen.tang
robo-dividend
Commits
44af8cfc
Commit
44af8cfc
authored
Nov 28, 2022
by
jichao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实盘完成待测试
parent
524994d7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
config.yml
config.yml
+4
-7
crisis_signal.py
rebalance/signals/crisis_signal.py
+2
-2
No files found.
config.yml
View file @
44af8cfc
...
...
@@ -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回报率跌破阀值
...
...
rebalance/signals/crisis_signal.py
View file @
44af8cfc
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment