Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
alpha-mind
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
Dr.李
alpha-mind
Commits
058c9bfd
Commit
058c9bfd
authored
Nov 23, 2020
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FIX: remove debug example
parent
d3022cc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
62 deletions
+0
-62
1. debug examples.py
notebooks/1. debug examples.py
+0
-62
No files found.
notebooks/1. debug examples.py
deleted
100644 → 0
View file @
d3022cc3
"""
Created on 2020-11-21
@author: cheng.li
"""
import
os
import
datetime
as
dt
import
numpy
as
np
import
pandas
as
pd
from
PyFin.api
import
*
from
alphamind.api
import
*
start_date
=
'2020-01-01'
end_date
=
'2020-02-21'
freq
=
'10b'
horizon
=
map_freq
(
freq
)
neutralized_risk
=
risk_styles
+
industry_styles
universe
=
Universe
(
'hs300'
)
data_source
=
"mysql+mysqldb://reader:Reader#2020@121.37.138.1:13317/vision?charset=utf8"
offset
=
1
method
=
'ls'
industry_name
=
'sw'
industry_level
=
1
risk_model
=
'short'
executor
=
NaiveExecutor
()
ref_dates
=
makeSchedule
(
start_date
,
end_date
,
freq
,
'china.sse'
)
engine
=
SqlEngine
(
data_source
)
alpha_factors
=
{
'f01'
:
LAST
(
'EMA5D'
),
'f02'
:
LAST
(
'EMV6D'
)
}
weights
=
dict
(
f01
=
1.0
,
f02
=
1.0
,
)
alpha_model
=
ConstLinearModel
(
features
=
alpha_factors
,
weights
=
weights
)
def
predict_worker
(
params
):
data_meta
=
DataMeta
(
freq
=
freq
,
universe
=
universe
,
batch
=
1
,
neutralized_risk
=
neutralized_risk
,
risk_model
=
'short'
,
pre_process
=
[
winsorize_normal
,
standardize
],
post_process
=
[
standardize
],
warm_start
=
0
,
data_source
=
data_source
)
ref_date
,
model
=
params
er
,
_
=
predict_by_model
(
ref_date
,
model
,
data_meta
)
return
er
predicts
=
[
predict_worker
((
d
.
strftime
(
'
%
Y-
%
m-
%
d'
),
alpha_model
))
for
d
in
ref_dates
]
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