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
00ffb6de
Commit
00ffb6de
authored
Dec 01, 2022
by
jichao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
使用异步框架
parent
a4e059a9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
4 deletions
+3
-4
asset_risk.py
asset_pool/asset_risk.py
+1
-1
config.yml
config.yml
+1
-1
robo_executor.py
robo_executor.py
+1
-2
No files found.
asset_pool/asset_risk.py
View file @
00ffb6de
...
@@ -34,7 +34,7 @@ class CvarEwmaAssetRisk(AssetRisk):
...
@@ -34,7 +34,7 @@ class CvarEwmaAssetRisk(AssetRisk):
def
get_risk_pool
(
self
,
day
):
def
get_risk_pool
(
self
,
day
):
asset_pool
=
rap
.
get_one
(
day
,
AssetPoolType
.
RISK
)
asset_pool
=
rap
.
get_one
(
day
,
AssetPoolType
.
RISK
)
if
not
asset_pool
:
if
not
asset_pool
:
result
=
{
x
[
'id'
]:
self
.
is_risk
(
x
[
'id'
],
day
)
for
x
in
self
.
_datum
.
get_fund_datums
(
risk
=
(
3
,
4
,
5
))}
result
=
{
x
[
'id'
]:
self
.
async_
is_risk
(
x
[
'id'
],
day
)
for
x
in
self
.
_datum
.
get_fund_datums
(
risk
=
(
3
,
4
,
5
))}
risk_ids
=
[
x
[
0
]
for
x
in
result
.
items
()
if
x
[
1
]
.
result
()]
risk_ids
=
[
x
[
0
]
for
x
in
result
.
items
()
if
x
[
1
]
.
result
()]
rap
.
insert
(
day
,
AssetPoolType
.
RISK
,
risk_ids
)
rap
.
insert
(
day
,
AssetPoolType
.
RISK
,
risk_ids
)
asset_pool
=
rap
.
get_one
(
day
,
AssetPoolType
.
RISK
)
asset_pool
=
rap
.
get_one
(
day
,
AssetPoolType
.
RISK
)
...
...
config.yml
View file @
00ffb6de
...
@@ -153,7 +153,7 @@ robo-executor: # 执行器相关
...
@@ -153,7 +153,7 @@ robo-executor: # 执行器相关
backtest
:
# 回测执行器相关
backtest
:
# 回测执行器相关
start-date
:
2008-01-02
# 回测起始日期
start-date
:
2008-01-02
# 回测起始日期
end-date
:
2022-11-01
# 回测截止日期
end-date
:
2022-11-01
# 回测截止日期
start-step
:
1
# 回测从哪一步开始执行 1:计算资产ewma;2:计算资产池;3:计算最优投组:4:计算再平衡信号以及持仓投组
start-step
:
2
# 回测从哪一步开始执行 1:计算资产ewma;2:计算资产池;3:计算最优投组:4:计算再平衡信号以及持仓投组
real
:
# 实盘执行器
real
:
# 实盘执行器
start-date
:
2022-11-01
# 实盘开始时间
start-date
:
2022-11-01
# 实盘开始时间
...
...
robo_executor.py
View file @
00ffb6de
...
@@ -8,7 +8,7 @@ from concurrent.futures import wait
...
@@ -8,7 +8,7 @@ from concurrent.futures import wait
import
pandas
as
pd
import
pandas
as
pd
from
py_jftech
import
(
from
py_jftech
import
(
component
,
autowired
,
get_config
,
filter_weekend
,
asynchronized
,
component
,
autowired
,
get_config
,
filter_weekend
,
asynchronized
,
workday_range
,
format_date
,
prev_workday
,
parse_date
workday_range
,
format_date
,
prev_workday
,
parse_date
,
transaction
)
)
from
api
import
(
from
api
import
(
...
@@ -101,7 +101,6 @@ class BacktestExector(RoboExecutor):
...
@@ -101,7 +101,6 @@ class BacktestExector(RoboExecutor):
@
asynchronized
(
isolate
=
True
)
@
asynchronized
(
isolate
=
True
)
def
async_build_risk_date
(
self
,
asset_id
):
def
async_build_risk_date
(
self
,
asset_id
):
print
(
asset_id
)
self
.
_risk
.
build_risk_date
(
asset_id
,
self
.
end_date
)
self
.
_risk
.
build_risk_date
(
asset_id
,
self
.
end_date
)
@
asynchronized
(
isolate
=
True
)
@
asynchronized
(
isolate
=
True
)
...
...
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