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
3418e444
Commit
3418e444
authored
Jan 28, 2023
by
jichao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定版
parent
59181600
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
api.py
api.py
+1
-2
ruler.py
rebalance/ruler.py
+1
-1
No files found.
api.py
View file @
3418e444
...
...
@@ -520,12 +520,11 @@ class RebalanceRuler(ABC):
'''
@
abstractmethod
def
take_next_signal
(
self
,
day
,
risk
:
PortfoliosRisk
,
only_today
=
True
):
def
take_next_signal
(
self
,
day
,
risk
:
PortfoliosRisk
):
'''
取出指定日期,指定风险等级的再平衡信号数据,注意取出消费后,无法退回,非幂等函数
:param day: 指定日期
:param risk: 指定风险等级
:param only_today: 只获取今天是否有信号
:return: 如果存在,则返回取出的再平衡信号信息,否则返回None
'''
pass
...
...
rebalance/ruler.py
View file @
3418e444
...
...
@@ -45,7 +45,7 @@ class LevelRebalanceRuler(RebalanceRuler):
return
len
(
workday_range
(
last_re
[
'date'
],
day
))
>
self
.
disable_period
[
SignalType
(
last_re
[
'type'
])
.
p_type
]
return
False
def
take_next_signal
(
self
,
day
,
risk
:
PortfoliosRisk
,
only_today
=
True
):
def
take_next_signal
(
self
,
day
,
risk
:
PortfoliosRisk
):
last_re
=
rrs
.
get_last_one
(
max_date
=
day
,
risk
=
risk
,
effective
=
True
)
if
not
last_re
:
builder
=
[
x
for
x
in
self
.
_signals
if
x
.
signal_type
is
SignalType
.
INIT
][
0
]
...
...
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