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
64259fc1
Commit
64259fc1
authored
Nov 14, 2020
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FEATURE: added benchmark fetching
parent
14c686dd
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
300 additions
and
3 deletions
+300
-3
__init__.py
alphamind/data/dbmodel/models/__init__.py
+4
-1
models_rl.py
alphamind/data/dbmodel/models/models_rl.py
+47
-0
__init__.py
alphamind/data/engines/sqlengine/__init__.py
+1
-1
sqlengine_rl.py
alphamind/data/engines/sqlengine/sqlengine_rl.py
+248
-1
No files found.
alphamind/data/dbmodel/models/__init__.py
View file @
64259fc1
...
...
@@ -8,6 +8,7 @@ import os
if
"DB_VENDOR"
in
os
.
environ
and
os
.
environ
[
"DB_VENDOR"
]
.
lower
()
==
"rl"
:
from
alphamind.data.dbmodel.models.models_rl
import
Market
from
alphamind.data.dbmodel.models.models_rl
import
IndexMarket
from
alphamind.data.dbmodel.models.models_rl
import
Universe
from
alphamind.data.dbmodel.models.models_rl
import
Industry
from
alphamind.data.dbmodel.models.models_rl
import
RiskExposure
...
...
@@ -17,8 +18,11 @@ if "DB_VENDOR" in os.environ and os.environ["DB_VENDOR"].lower() == "rl":
from
alphamind.data.dbmodel.models.models_rl
import
SpecificRiskDay
from
alphamind.data.dbmodel.models.models_rl
import
SpecificRiskShort
from
alphamind.data.dbmodel.models.models_rl
import
SpecificRiskLong
from
alphamind.data.dbmodel.models.models_rl
import
IndexComponent
from
alphamind.data.dbmodel.models.models_rl
import
IndexWeight
else
:
from
alphamind.data.dbmodel.models.models
import
Market
from
alphamind.data.dbmodel.models.models
import
IndexMarket
from
alphamind.data.dbmodel.models.models
import
Universe
from
alphamind.data.dbmodel.models.models
import
Industry
from
alphamind.data.dbmodel.models.models
import
RiskExposure
...
...
@@ -30,5 +34,4 @@ else:
from
alphamind.data.dbmodel.models.models
import
SpecificRiskLong
from
alphamind.data.dbmodel.models.models
import
FactorMaster
from
alphamind.data.dbmodel.models.models
import
IndexComponent
from
alphamind.data.dbmodel.models.models
import
IndexMarket
from
alphamind.data.dbmodel.models.models
import
RiskMaster
alphamind/data/dbmodel/models/models_rl.py
View file @
64259fc1
...
...
@@ -35,6 +35,50 @@ class _StkDailyPricePro(Base):
is_verify
=
Column
(
INT
,
index
=
True
,
server_default
=
text
(
"'0'"
))
class
_IndexDailyPrice
(
Base
):
__tablename__
=
'index_daily_price'
__table_args__
=
(
Index
(
'unique_index_daily_price_index'
,
'trade_date'
,
'security_code'
,
'flag'
,
unique
=
True
),
)
id
=
Column
(
INT
,
primary_key
=
True
)
trade_date
=
Column
(
Date
)
indexCode
=
Column
(
"security_code"
,
Text
)
chgPct
=
Column
(
"change_pct"
,
FLOAT
)
secShortName
=
Column
(
"name"
,
Text
)
is_valid
=
Column
(
INT
,
nullable
=
False
)
flag
=
Column
(
INT
,
index
=
True
,
server_default
=
text
(
"'1'"
))
is_verify
=
Column
(
INT
,
index
=
True
,
server_default
=
text
(
"'0'"
))
class
_Index
(
Base
):
__tablename__
=
"index"
__table_args__
=
(
Index
(
'unique_index_index'
,
'trade_date'
,
'isymbol'
,
'symbol'
,
'flag'
,
unique
=
True
),
)
id
=
Column
(
INT
,
primary_key
=
True
)
trade_date
=
Column
(
Date
)
indexSymbol
=
Column
(
"isymbol"
,
Text
)
symbol
=
Column
(
Text
)
weight
=
Column
(
"weighing"
,
FLOAT
)
flag
=
Column
(
INT
,
index
=
True
,
server_default
=
text
(
"'1'"
))
class
_IndexComponent
(
Base
):
__tablename__
=
"index_component"
__table_args__
=
(
Index
(
'unique_index_index'
,
'trade_date'
,
'isecurity_code'
,
'security_code'
,
'flag'
,
unique
=
True
),
)
id
=
Column
(
INT
,
primary_key
=
True
)
trade_date
=
Column
(
Date
)
indexSymbol
=
Column
(
"isymbol"
,
Text
)
symbol
=
Column
(
Text
)
indexCode
=
Column
(
"isecurity_code"
,
Text
)
code
=
Column
(
"security_code"
,
Text
)
flag
=
Column
(
INT
,
index
=
True
,
server_default
=
text
(
"'1'"
))
class
_StkUniverse
(
Base
):
__tablename__
=
'stk_universe'
__table_args__
=
(
...
...
@@ -358,6 +402,7 @@ class _SpecificRiskShort(Base):
Market
=
_StkDailyPricePro
IndexMarket
=
_IndexDailyPrice
Universe
=
_StkUniverse
Industry
=
_SwIndustryDaily
RiskExposure
=
_RiskExposure
...
...
@@ -367,3 +412,5 @@ RiskCovLong = _RiskCovLong
SpecificRiskDay
=
_SpecificRiskDay
SpecificRiskShort
=
_SpecificRiskShort
SpecificRiskLong
=
_SpecificRiskLong
IndexComponent
=
_IndexComponent
IndexWeight
=
_Index
alphamind/data/engines/sqlengine/__init__.py
View file @
64259fc1
...
...
@@ -14,7 +14,7 @@ if "DB_VENDOR" in os.environ and os.environ["DB_VENDOR"].lower() == "rl":
from
alphamind.data.engines.sqlengine.sqlengine_rl
import
risk_styles
from
alphamind.data.engines.sqlengine.sqlengine_rl
import
macro_styles
else
:
from
alphamind.data.engines.sqlengine
import
SqlEngine
from
alphamind.data.engines.sqlengine
.sqlengine
import
SqlEngine
from
alphamind.data.engines.sqlengine.sqlengine
import
total_risk_factors
from
alphamind.data.engines.sqlengine.sqlengine
import
industry_styles
from
alphamind.data.engines.sqlengine.sqlengine
import
risk_styles
...
...
alphamind/data/engines/sqlengine/sqlengine_rl.py
View file @
64259fc1
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