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
b1c1d69f
Commit
b1c1d69f
authored
Jan 18, 2018
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update examples
parent
e25eb965
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
factor_analysis_example.py
alphamind/examples/factor_analysis_example.py
+3
-4
factor_res_analysis.py
alphamind/examples/factor_res_analysis.py
+4
-4
No files found.
alphamind/examples/factor_analysis_example.py
View file @
b1c1d69f
...
...
@@ -48,10 +48,9 @@ Model phase: we need 1 constant linear model and one linear regression model
"""
alpha_name
=
[
'alpha_factor'
]
#const_features = {alpha_name[0]: LAST('optimism_confidence_25d') + LAST('pessimism_confidence_25d')}
# const_features = {alpha_name[0]: CSRes(DIFF(1. / LAST('PE')), LAST('roe_q'))}
simple_expression
=
LAST
(
'cfinc1_q'
)
# CSRes(CSRes(LAST('DividendPS'), LAST('roe_q')), LAST('ep_q'))
base1
=
LAST
(
'roe_q'
)
base2
=
CSRes
(
LAST
(
'ep_q'
),
'roe_q'
)
simple_expression
=
CSRes
(
CSRes
(
LAST
(
'DividendPS'
),
base1
),
base2
)
const_features
=
{
alpha_name
[
0
]:
simple_expression
}
const_weights
=
np
.
array
([
1.
])
...
...
alphamind/examples/factor_res_analysis.py
View file @
b1c1d69f
...
...
@@ -75,14 +75,14 @@ def factor_residue_analysis(start_date,
engine
=
SqlEngine
()
#
df = engine.fetch_factor_coverage().groupby('factor').mean()
#
df = df[df.coverage >= 0.98]
df
=
engine
.
fetch_factor_coverage
()
.
groupby
(
'factor'
)
.
mean
()
df
=
df
[
df
.
coverage
>=
0.98
]
universe
=
Universe
(
'custom'
,
[
'zz800'
])
factor_df
=
pd
.
DataFrame
()
for
i
,
factor
in
enumerate
(
[
'EGRO'
]
):
res
=
factor_residue_analysis
(
'201
2
-01-01'
,
for
i
,
factor
in
enumerate
(
df
.
index
):
res
=
factor_residue_analysis
(
'201
1
-01-01'
,
'2018-01-05'
,
factor
,
'5b'
,
...
...
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