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
e5dc9c53
Commit
e5dc9c53
authored
Jul 13, 2017
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added strategy api
parent
d18cf28c
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
265 additions
and
35 deletions
+265
-35
sqlengine.py
alphamind/data/engines/sqlengine.py
+11
-0
Summary_500_long_top.xlsx
notebooks/Summary_500_long_top.xlsx
+0
-0
Summary_500_risk_neutral.xlsx
notebooks/Summary_500_risk_neutral.xlsx
+0
-0
optimizer check.ipynb
notebooks/optimizer check.ipynb
+254
-35
No files found.
alphamind/data/engines/sqlengine.py
View file @
e5dc9c53
...
...
@@ -75,6 +75,17 @@ class SqlEngine(object):
sql
=
"select * from factor_master"
return
pd
.
read_sql
(
sql
,
self
.
engine
)
def
fetch_strategy
(
self
,
ref_date
:
str
,
strategy
:
str
)
->
pd
.
DataFrame
():
sql
=
"select strategyName, factor, weight from strategy "
\
"where Date = '{ref_date}' and strategyName = '{strategy}'"
.
format
(
ref_date
=
ref_date
,
strategy
=
strategy
)
return
pd
.
read_sql
(
sql
,
self
.
engine
)
def
fetch_strategy_names
(
self
):
sql
=
"select distinct strategyName from strategy"
cursor
=
self
.
engine
.
execute
(
sql
)
strategy_names
=
{
c
[
0
]
for
c
in
cursor
.
fetchall
()}
return
strategy_names
def
fetch_codes
(
self
,
ref_date
:
str
,
univ
:
Universe
)
->
List
[
int
]:
def
get_universe
(
univ
,
ref_date
):
...
...
notebooks/Summary_500_long_top.xlsx
deleted
100644 → 0
View file @
d18cf28c
File deleted
notebooks/Summary_500_risk_neutral.xlsx
deleted
100644 → 0
View file @
d18cf28c
File deleted
notebooks/optimizer check.ipynb
View file @
e5dc9c53
This diff is collapsed.
Click to expand it.
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