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
c81dcea7
Commit
c81dcea7
authored
Jan 11, 2023
by
jichao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整信号规则逻辑
parent
894c849f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
crisis_signal.py
rebalance/signals/crisis_signal.py
+12
-5
No files found.
rebalance/signals/crisis_signal.py
View file @
c81dcea7
...
@@ -48,11 +48,18 @@ class CrisisSignal(BaseRebalanceSignal, ABC):
...
@@ -48,11 +48,18 @@ class CrisisSignal(BaseRebalanceSignal, ABC):
two_today
=
self
.
_navs
.
get_last_index_close
(
max_date
=
day
,
ticker
=
'USGG2YR Index'
)
two_today
=
self
.
_navs
.
get_last_index_close
(
max_date
=
day
,
ticker
=
'USGG2YR Index'
)
if
ten_today
[
'close'
]
-
two_today
[
'close'
]
<=
ten_before
[
'close'
]
-
two_before
[
'close'
]
and
\
if
ten_today
[
'close'
]
-
two_today
[
'close'
]
<=
ten_before
[
'close'
]
-
two_before
[
'close'
]
and
\
ten_today
[
'close'
]
-
two_today
[
'close'
]
<=
self
.
inversion_threshold
:
ten_today
[
'close'
]
-
two_today
[
'close'
]
<=
self
.
inversion_threshold
:
rrs
.
insert
({
last_signal
=
rrs
.
get_last_one
(
max_date
=
day
,
risk
=
risk
)
'date'
:
day
,
if
SignalType
(
last_signal
[
'type'
])
is
SignalType
.
NONE
:
'type'
:
SignalType
.
CRISIS_EXP
,
rrs
.
update
(
last_signal
[
'id'
],
{
'risk'
:
risk
,
'date'
:
day
,
})
'type'
:
SignalType
.
CRISIS_EXP
,
})
else
:
rrs
.
insert
({
'date'
:
day
,
'type'
:
SignalType
.
CRISIS_EXP
,
'risk'
:
risk
,
})
exp_signal
=
rrs
.
get_first_after
(
type
=
SignalType
.
CRISIS_EXP
,
risk
=
risk
,
min_date
=
exp_date
)
exp_signal
=
rrs
.
get_first_after
(
type
=
SignalType
.
CRISIS_EXP
,
risk
=
risk
,
min_date
=
exp_date
)
return
exp_signal
[
'date'
]
if
exp_signal
else
None
return
exp_signal
[
'date'
]
if
exp_signal
else
None
...
...
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