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
5fe5c273
Commit
5fe5c273
authored
Jan 16, 2023
by
jichao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整信号规则逻辑
parent
d1e8161e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
ruler.py
rebalance/ruler.py
+1
-1
test_case.py
rebalance/test_case.py
+1
-1
No files found.
rebalance/ruler.py
View file @
5fe5c273
...
@@ -68,7 +68,7 @@ class LevelRebalanceRuler(RebalanceRuler):
...
@@ -68,7 +68,7 @@ class LevelRebalanceRuler(RebalanceRuler):
signals
=
{
x
[
0
]:
x
[
1
]
for
x
in
signals
.
items
()
if
x
[
0
]
not
in
[
SignalType
.
CRISIS_ONE
,
SignalType
.
CRISIS_TWO
]}
signals
=
{
x
[
0
]:
x
[
1
]
for
x
in
signals
.
items
()
if
x
[
0
]
not
in
[
SignalType
.
CRISIS_ONE
,
SignalType
.
CRISIS_TWO
]}
# 检查买入信号,只有当天需要检查
# 检查买入信号,只有当天需要检查
if
not
signals
and
self
.
without_disable_period
(
day
,
risk
):
if
not
signals
and
self
.
without_disable_period
(
day
,
risk
):
signals
=
{
x
.
signal_type
:
x
.
get_signal
(
start
,
risk
)
for
x
in
buy_signals
}
signals
=
{
x
.
signal_type
:
x
.
get_signal
(
day
,
risk
)
for
x
in
buy_signals
}
signals
=
{
x
[
0
]:
x
[
1
]
for
x
in
signals
.
items
()
if
x
[
1
]
is
not
None
}
signals
=
{
x
[
0
]:
x
[
1
]
for
x
in
signals
.
items
()
if
x
[
1
]
is
not
None
}
if
signals
:
if
signals
:
if
SignalType
(
last_signal
[
'type'
])
is
SignalType
.
NONE
:
if
SignalType
(
last_signal
[
'type'
])
is
SignalType
.
NONE
:
...
...
rebalance/test_case.py
View file @
5fe5c273
...
@@ -23,7 +23,7 @@ class RebalanceTest(unittest.TestCase):
...
@@ -23,7 +23,7 @@ class RebalanceTest(unittest.TestCase):
@
autowired
(
names
=
{
'builder'
:
'crisis_two'
})
@
autowired
(
names
=
{
'builder'
:
'crisis_two'
})
def
test_crisis_two
(
self
,
builder
:
RebalanceSignal
=
None
):
def
test_crisis_two
(
self
,
builder
:
RebalanceSignal
=
None
):
start
=
parse_date
(
'20
20-04-29
'
)
start
=
parse_date
(
'20
08-01-02
'
)
end
=
start
+
relativedelta
(
years
=
3
)
end
=
start
+
relativedelta
(
years
=
3
)
while
start
<
end
:
while
start
<
end
:
signal
=
builder
.
is_trigger
(
start
,
PortfoliosRisk
.
FT9
)
signal
=
builder
.
is_trigger
(
start
,
PortfoliosRisk
.
FT9
)
...
...
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