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
3ccae70f
Commit
3ccae70f
authored
Jan 11, 2023
by
jichao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整信号规则逻辑
parent
80aaec18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
32 deletions
+3
-32
config.yml
config.yml
+3
-4
right_side.py
rebalance/signals/right_side.py
+0
-28
No files found.
config.yml
View file @
3ccae70f
...
...
@@ -40,9 +40,8 @@ py-jftech:
api.PortfoliosBuilder
:
portfolios.builder.PoemPortfoliosBuilder
names
:
crisis_one
:
rebalance.signals.crisis_signal.LastRateCrisisOneSignal
date-curve
:
rebalance.drift_solver.DateCurve
curve-drift
:
rebalance.signals.curve_drift.Max120tCurveDrift
market-right
:
rebalance.signals.right_side.MarketRight
date-curve
:
rebalance.drift_solver.NonnegativeDateCurve
curve-drift
:
rebalance.signals.curve_drift.AbsCurveDrift
email
:
server
:
smtphz.qiye.163.com
user
:
jft-ra@thizgroup.com
...
...
@@ -150,7 +149,7 @@ rebalance: # 再平衡模块
crisis-1
:
# 危机1相关
mean-count
:
850
# spx去多少交易日计算平均值
consecut-days
:
5
# spx连续多少天跌破平均值则触发
threshold
:
-0.
1
# spx计算后跌破阀值
threshold
:
-0.
05
# spx计算后跌破阀值
crisis-2
:
# 危机2相关
negative-growth
:
1
# 实际利率负增长时长,单位年,点到点取值
fed-months
:
3
# fed 滚动月份,点到点取值
...
...
rebalance/signals/right_side.py
View file @
3ccae70f
...
...
@@ -91,31 +91,3 @@ class MarketRight(BaseRebalanceSignal):
spx
.
dropna
(
inplace
=
True
)
spx
=
spx
[[
'date'
,
'close'
,
'rtn'
]]
return
spx
.
to_dict
(
'records'
)
@
component
(
bean_name
=
'market-right'
)
class
FallMarketRight
(
MarketRight
):
def
is_fall
(
self
,
day
,
risk
:
PortfoliosRisk
,
spx
=
None
):
if
spx
is
None
:
spx
=
self
.
load_spx_close_rtns
(
day
)
start_date
=
self
.
find_cvar_start_date
(
day
,
risk
,
spx
=
spx
)
if
start_date
:
spx
=
pd
.
DataFrame
(
spx
)
spx
=
spx
[(
spx
.
date
>=
start_date
)
&
(
spx
.
date
<=
day
)]
return
spx
.
iloc
[
-
1
]
.
close
<
spx
.
iloc
[
0
]
.
close
return
False
def
is_trigger
(
self
,
day
,
risk
:
PortfoliosRisk
)
->
bool
:
last_re
=
rrs
.
get_last_one
(
risk
=
risk
,
max_date
=
day
,
effective
=
True
)
if
last_re
is
not
None
and
SignalType
(
last_re
[
'type'
])
in
self
.
include_last_type
:
return
False
spx
=
self
.
load_spx_close_rtns
(
day
)
if
self
.
is_fall
(
day
,
risk
,
spx
=
spx
):
return
True
if
spx
[
-
1
][
'rtn'
]
>
self
.
min_threshold
:
return
False
cvar
=
self
.
get_cvar
(
day
,
risk
,
spx
=
spx
)
return
cvar
is
not
None
and
spx
[
-
1
][
'rtn'
]
<
cvar
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