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
9e66adbd
Commit
9e66adbd
authored
Aug 25, 2017
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update models
parent
c2e4ea6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
118 additions
and
118 deletions
+118
-118
models.py
alphamind/data/dbmodel/models.py
+118
-118
No files found.
alphamind/data/dbmodel/models.py
View file @
9e66adbd
...
@@ -5,7 +5,7 @@ Created on 2017-6-29
...
@@ -5,7 +5,7 @@ Created on 2017-6-29
@author: cheng.li
@author: cheng.li
"""
"""
from
sqlalchemy
import
BigInteger
,
Column
,
DateTime
,
Float
,
Index
,
Integer
,
String
,
Text
,
text
,
JSON
from
sqlalchemy
import
BigInteger
,
Column
,
DateTime
,
Float
,
Index
,
Integer
,
JSON
,
String
,
Text
,
text
from
sqlalchemy.ext.declarative
import
declarative_base
from
sqlalchemy.ext.declarative
import
declarative_base
...
@@ -16,27 +16,26 @@ metadata = Base.metadata
...
@@ -16,27 +16,26 @@ metadata = Base.metadata
class
DailyReturn
(
Base
):
class
DailyReturn
(
Base
):
__tablename__
=
'daily_return'
__tablename__
=
'daily_return'
__table_args__
=
(
__table_args__
=
(
Index
(
'daily_return_Date_Code_uindex'
,
'
Date'
,
'C
ode'
,
unique
=
True
),
Index
(
'daily_return_Date_Code_uindex'
,
'
trade_date'
,
'c
ode'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
C
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
c
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
d1
=
Column
(
Float
(
53
))
d1
=
Column
(
Float
(
53
))
class
Experimental
(
Base
):
class
Experimental
(
Base
):
__tablename__
=
'experimental'
__tablename__
=
'experimental'
__table_args__
=
(
__table_args__
=
(
Index
(
'experimental_Date_Code_uindex'
,
'
Date'
,
'C
ode'
,
unique
=
True
),
Index
(
'experimental_Date_Code_uindex'
,
'
trade_date'
,
'c
ode'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
C
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
c
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
CHV
=
Column
(
Float
(
53
))
CHV
=
Column
(
Float
(
53
))
DROE
=
Column
(
Float
(
53
))
DROE
=
Column
(
Float
(
53
))
IVR
=
Column
(
Float
(
53
))
IVR
=
Column
(
Float
(
53
))
ROEAfterNonRecurring
=
Column
(
Float
(
53
))
ROEAfterNonRecurring
=
Column
(
Float
(
53
))
EPAfterNonRecurring
=
Column
(
Float
(
53
))
class
FactorMaster
(
Base
):
class
FactorMaster
(
Base
):
...
@@ -49,17 +48,17 @@ class FactorMaster(Base):
...
@@ -49,17 +48,17 @@ class FactorMaster(Base):
source
=
Column
(
String
(
30
),
primary_key
=
True
,
nullable
=
False
)
source
=
Column
(
String
(
30
),
primary_key
=
True
,
nullable
=
False
)
alias
=
Column
(
String
(
50
),
nullable
=
False
)
alias
=
Column
(
String
(
50
),
nullable
=
False
)
updateTime
=
Column
(
DateTime
)
updateTime
=
Column
(
DateTime
)
description
=
Column
(
Text
()
)
description
=
Column
(
Text
)
class
HaltList
(
Base
):
class
HaltList
(
Base
):
__tablename__
=
'halt_list'
__tablename__
=
'halt_list'
__table_args__
=
(
__table_args__
=
(
Index
(
'halt_list_Date_Code_haltBeginTime_uindex'
,
'
Date'
,
'C
ode'
,
'haltBeginTime'
,
unique
=
True
),
Index
(
'halt_list_Date_Code_haltBeginTime_uindex'
,
'
trade_date'
,
'c
ode'
,
'haltBeginTime'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
C
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
c
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
haltBeginTime
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
haltBeginTime
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
haltEndTime
=
Column
(
DateTime
)
haltEndTime
=
Column
(
DateTime
)
secShortName
=
Column
(
String
(
20
))
secShortName
=
Column
(
String
(
20
))
...
@@ -72,11 +71,11 @@ class HaltList(Base):
...
@@ -72,11 +71,11 @@ class HaltList(Base):
class
IndexComponent
(
Base
):
class
IndexComponent
(
Base
):
__tablename__
=
'index_components'
__tablename__
=
'index_components'
__table_args__
=
(
__table_args__
=
(
Index
(
'index_components_Date_indexCode_Code_uindex'
,
'
Date'
,
'indexCode'
,
'C
ode'
,
unique
=
True
),
Index
(
'index_components_Date_indexCode_Code_uindex'
,
'
trade_date'
,
'indexCode'
,
'c
ode'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
C
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
c
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
effDate
=
Column
(
DateTime
)
effDate
=
Column
(
DateTime
)
indexShortName
=
Column
(
String
(
20
))
indexShortName
=
Column
(
String
(
20
))
indexCode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
indexCode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
...
@@ -88,11 +87,11 @@ class IndexComponent(Base):
...
@@ -88,11 +87,11 @@ class IndexComponent(Base):
class
Industry
(
Base
):
class
Industry
(
Base
):
__tablename__
=
'industry'
__tablename__
=
'industry'
__table_args__
=
(
__table_args__
=
(
Index
(
'industry_Date_Code_industryID_uindex'
,
'
Date'
,
'C
ode'
,
'industryID'
,
unique
=
True
),
Index
(
'industry_Date_Code_industryID_uindex'
,
'
trade_date'
,
'c
ode'
,
'industryID'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
C
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
c
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
industry
=
Column
(
String
(
30
),
nullable
=
False
)
industry
=
Column
(
String
(
30
),
nullable
=
False
)
industryID
=
Column
(
BigInteger
,
primary_key
=
True
,
nullable
=
False
)
industryID
=
Column
(
BigInteger
,
primary_key
=
True
,
nullable
=
False
)
industrySymbol
=
Column
(
String
(
20
))
industrySymbol
=
Column
(
String
(
20
))
...
@@ -109,11 +108,11 @@ class Industry(Base):
...
@@ -109,11 +108,11 @@ class Industry(Base):
class
LegacyFactor
(
Base
):
class
LegacyFactor
(
Base
):
__tablename__
=
'legacy_factor'
__tablename__
=
'legacy_factor'
__table_args__
=
(
__table_args__
=
(
Index
(
'legacy_factor_Date_Code_uindex'
,
'
Date'
,
'C
ode'
,
unique
=
True
),
Index
(
'legacy_factor_Date_Code_uindex'
,
'
trade_date'
,
'c
ode'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
C
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
c
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
ROEAfterNonRecurring
=
Column
(
Float
(
53
))
ROEAfterNonRecurring
=
Column
(
Float
(
53
))
EPSAfterNonRecurring
=
Column
(
Float
(
53
))
EPSAfterNonRecurring
=
Column
(
Float
(
53
))
EODPrice
=
Column
(
Float
(
53
))
EODPrice
=
Column
(
Float
(
53
))
...
@@ -185,11 +184,11 @@ class LegacyFactor(Base):
...
@@ -185,11 +184,11 @@ class LegacyFactor(Base):
class
Market
(
Base
):
class
Market
(
Base
):
__tablename__
=
'market'
__tablename__
=
'market'
__table_args__
=
(
__table_args__
=
(
Index
(
'market_Date_Code_uindex'
,
'
Date'
,
'C
ode'
,
unique
=
True
),
Index
(
'market_Date_Code_uindex'
,
'
trade_date'
,
'c
ode'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
C
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
c
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
secShortName
=
Column
(
String
(
10
))
secShortName
=
Column
(
String
(
10
))
exchangeCD
=
Column
(
String
(
4
))
exchangeCD
=
Column
(
String
(
4
))
preClosePrice
=
Column
(
Float
(
53
))
preClosePrice
=
Column
(
Float
(
53
))
...
@@ -209,18 +208,18 @@ class Market(Base):
...
@@ -209,18 +208,18 @@ class Market(Base):
PE
=
Column
(
Float
(
53
))
PE
=
Column
(
Float
(
53
))
PE1
=
Column
(
Float
(
53
))
PE1
=
Column
(
Float
(
53
))
PB
=
Column
(
Float
(
53
))
PB
=
Column
(
Float
(
53
))
vwap
=
Column
(
Float
(
53
))
isOpen
=
Column
(
Integer
)
isOpen
=
Column
(
Integer
)
vwap
=
Column
(
Float
(
53
))
class
Performance
(
Base
):
class
Performance
(
Base
):
__tablename__
=
'performance'
__tablename__
=
'performance'
__table_args__
=
(
__table_args__
=
(
Index
(
'performance_
Date_type_portfolio_industry_source_universe_uindex'
,
'Date'
,
'type'
,
'portfolio'
,
'industry'
,
'source'
,
'universe'
,
unique
=
True
),
Index
(
'performance_
type_industry_universe_portfolio_index'
,
'type'
,
'industry'
,
'universe'
,
'portfolio'
),
Index
(
'performance_
type_industry_universe_portfolio_index'
,
'type'
,
'industry'
,
'universe'
,
'portfolio'
)
Index
(
'performance_
Date_type_portfolio_industry_source_universe_uindex'
,
'trade_date'
,
'type'
,
'portfolio'
,
'industry'
,
'source'
,
'universe'
,
unique
=
True
)
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
type
=
Column
(
String
(
20
),
primary_key
=
True
,
nullable
=
False
)
type
=
Column
(
String
(
20
),
primary_key
=
True
,
nullable
=
False
)
portfolio
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
portfolio
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
industry
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
industry
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
...
@@ -234,11 +233,11 @@ class Performance(Base):
...
@@ -234,11 +233,11 @@ class Performance(Base):
class
Performance2
(
Base
):
class
Performance2
(
Base
):
__tablename__
=
'performance2'
__tablename__
=
'performance2'
__table_args__
=
(
__table_args__
=
(
Index
(
'performance2_uindex'
,
'
D
ate'
,
'type'
,
'portfolio'
,
'industry'
,
'source'
,
'universe'
,
'benchmark'
,
unique
=
True
),
Index
(
'performance2_uindex'
,
'
trade_d
ate'
,
'type'
,
'portfolio'
,
'industry'
,
'source'
,
'universe'
,
'benchmark'
,
unique
=
True
),
Index
(
'performance2_index'
,
'type'
,
'industry'
,
'universe'
,
'portfolio'
)
Index
(
'performance2_index'
,
'type'
,
'industry'
,
'universe'
,
'portfolio'
)
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
type
=
Column
(
String
(
20
),
primary_key
=
True
,
nullable
=
False
)
type
=
Column
(
String
(
20
),
primary_key
=
True
,
nullable
=
False
)
portfolio
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
portfolio
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
industry
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
industry
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
...
@@ -250,26 +249,45 @@ class Performance2(Base):
...
@@ -250,26 +249,45 @@ class Performance2(Base):
ic
=
Column
(
Float
(
53
))
ic
=
Column
(
Float
(
53
))
class
Position
s
(
Base
):
class
Position
(
Base
):
__tablename__
=
'positions'
__tablename__
=
'positions'
source
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
,
index
=
True
)
source
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
,
index
=
True
)
universe
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
,
index
=
True
)
universe
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
,
index
=
True
)
benchmark
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
,
index
=
True
)
benchmark
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
,
index
=
True
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
,
index
=
True
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
,
index
=
True
)
portfolio
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
,
index
=
True
)
portfolio
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
,
index
=
True
)
type
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
,
index
=
True
)
type
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
,
index
=
True
)
weight
=
Column
(
JSON
)
weight
=
Column
(
JSON
)
class
QuantileAnalysi
(
Base
):
__tablename__
=
'quantile_analysis'
trade_date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
portfolio
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
universe
=
Column
(
String
(
20
),
primary_key
=
True
,
nullable
=
False
)
benchmark
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
q1
=
Column
(
Float
(
53
))
q2
=
Column
(
Float
(
53
))
q3
=
Column
(
Float
(
53
))
q4
=
Column
(
Float
(
53
))
q5
=
Column
(
Float
(
53
))
q6
=
Column
(
Float
(
53
))
q7
=
Column
(
Float
(
53
))
q8
=
Column
(
Float
(
53
))
q9
=
Column
(
Float
(
53
))
q10
=
Column
(
Float
(
53
))
class
RiskCovDay
(
Base
):
class
RiskCovDay
(
Base
):
__tablename__
=
'risk_cov_day'
__tablename__
=
'risk_cov_day'
__table_args__
=
(
__table_args__
=
(
Index
(
'risk_cov_day_Date_Factor
_uindex'
,
'Date'
,
'Factor
'
,
unique
=
True
),
Index
(
'risk_cov_day_Date_Factor
ID_uindex'
,
'trade_date'
,
'FactorID
'
,
unique
=
True
),
Index
(
'risk_cov_day_Date_Factor
ID_uindex'
,
'Date'
,
'FactorID
'
,
unique
=
True
)
Index
(
'risk_cov_day_Date_Factor
_uindex'
,
'trade_date'
,
'Factor
'
,
unique
=
True
)
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
FactorID
=
Column
(
Integer
)
FactorID
=
Column
(
Integer
)
Factor
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
Factor
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
BETA
=
Column
(
Float
(
53
))
BETA
=
Column
(
Float
(
53
))
...
@@ -317,11 +335,11 @@ class RiskCovDay(Base):
...
@@ -317,11 +335,11 @@ class RiskCovDay(Base):
class
RiskCovLong
(
Base
):
class
RiskCovLong
(
Base
):
__tablename__
=
'risk_cov_long'
__tablename__
=
'risk_cov_long'
__table_args__
=
(
__table_args__
=
(
Index
(
'risk_cov_long_Date_FactorID_uindex'
,
'
D
ate'
,
'FactorID'
,
unique
=
True
),
Index
(
'risk_cov_long_Date_FactorID_uindex'
,
'
trade_d
ate'
,
'FactorID'
,
unique
=
True
),
Index
(
'risk_cov_long_Date_Factor_uindex'
,
'
D
ate'
,
'Factor'
,
unique
=
True
)
Index
(
'risk_cov_long_Date_Factor_uindex'
,
'
trade_d
ate'
,
'Factor'
,
unique
=
True
)
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
FactorID
=
Column
(
Integer
)
FactorID
=
Column
(
Integer
)
Factor
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
Factor
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
BETA
=
Column
(
Float
(
53
))
BETA
=
Column
(
Float
(
53
))
...
@@ -369,11 +387,11 @@ class RiskCovLong(Base):
...
@@ -369,11 +387,11 @@ class RiskCovLong(Base):
class
RiskCovShort
(
Base
):
class
RiskCovShort
(
Base
):
__tablename__
=
'risk_cov_short'
__tablename__
=
'risk_cov_short'
__table_args__
=
(
__table_args__
=
(
Index
(
'risk_cov_short_Date_FactorID_uindex'
,
'
D
ate'
,
'FactorID'
,
unique
=
True
),
Index
(
'risk_cov_short_Date_FactorID_uindex'
,
'
trade_d
ate'
,
'FactorID'
,
unique
=
True
),
Index
(
'risk_cov_short_Date_Factor_uindex'
,
'
D
ate'
,
'Factor'
,
unique
=
True
)
Index
(
'risk_cov_short_Date_Factor_uindex'
,
'
trade_d
ate'
,
'Factor'
,
unique
=
True
)
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
FactorID
=
Column
(
Integer
)
FactorID
=
Column
(
Integer
)
Factor
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
Factor
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
BETA
=
Column
(
Float
(
53
))
BETA
=
Column
(
Float
(
53
))
...
@@ -421,11 +439,11 @@ class RiskCovShort(Base):
...
@@ -421,11 +439,11 @@ class RiskCovShort(Base):
class
RiskExposure
(
Base
):
class
RiskExposure
(
Base
):
__tablename__
=
'risk_exposure'
__tablename__
=
'risk_exposure'
__table_args__
=
(
__table_args__
=
(
Index
(
'risk_exposure_Date_Code_uindex'
,
'
Date'
,
'C
ode'
,
unique
=
True
),
Index
(
'risk_exposure_Date_Code_uindex'
,
'
trade_date'
,
'c
ode'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
C
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
c
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
exchangeCD
=
Column
(
String
(
4
))
exchangeCD
=
Column
(
String
(
4
))
secShortName
=
Column
(
String
(
20
))
secShortName
=
Column
(
String
(
20
))
BETA
=
Column
(
Float
(
53
))
BETA
=
Column
(
Float
(
53
))
...
@@ -478,7 +496,7 @@ class RiskMaster(Base):
...
@@ -478,7 +496,7 @@ class RiskMaster(Base):
alias
=
Column
(
String
(
30
),
nullable
=
False
)
alias
=
Column
(
String
(
30
),
nullable
=
False
)
type
=
Column
(
String
(
30
))
type
=
Column
(
String
(
30
))
updateTime
=
Column
(
DateTime
)
updateTime
=
Column
(
DateTime
)
description
=
Column
(
Text
()
)
description
=
Column
(
Text
)
FactorID
=
Column
(
Integer
,
nullable
=
False
,
unique
=
True
)
FactorID
=
Column
(
Integer
,
nullable
=
False
,
unique
=
True
)
vendor
=
Column
(
String
(
30
))
vendor
=
Column
(
String
(
30
))
...
@@ -486,7 +504,7 @@ class RiskMaster(Base):
...
@@ -486,7 +504,7 @@ class RiskMaster(Base):
class
RiskReturn
(
Base
):
class
RiskReturn
(
Base
):
__tablename__
=
'risk_return'
__tablename__
=
'risk_return'
Date
=
Column
(
DateTime
,
primary_key
=
True
,
unique
=
True
)
trade_date
=
Column
(
DateTime
,
primary_key
=
True
)
BETA
=
Column
(
Float
(
53
))
BETA
=
Column
(
Float
(
53
))
MOMENTUM
=
Column
(
Float
(
53
))
MOMENTUM
=
Column
(
Float
(
53
))
SIZE
=
Column
(
Float
(
53
))
SIZE
=
Column
(
Float
(
53
))
...
@@ -532,10 +550,10 @@ class RiskReturn(Base):
...
@@ -532,10 +550,10 @@ class RiskReturn(Base):
class
RiskStat
(
Base
):
class
RiskStat
(
Base
):
__tablename__
=
'risk_stats'
__tablename__
=
'risk_stats'
__table_args__
=
(
__table_args__
=
(
Index
(
'risk_stats_uindex'
,
'
D
ate'
,
'type'
,
'portfolio'
,
'source'
,
'universe'
,
'benchmark'
,
'factor'
,
unique
=
True
),
Index
(
'risk_stats_uindex'
,
'
trade_d
ate'
,
'type'
,
'portfolio'
,
'source'
,
'universe'
,
'benchmark'
,
'factor'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
type
=
Column
(
String
(
20
),
primary_key
=
True
,
nullable
=
False
)
type
=
Column
(
String
(
20
),
primary_key
=
True
,
nullable
=
False
)
portfolio
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
portfolio
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
source
=
Column
(
String
(
20
),
primary_key
=
True
,
nullable
=
False
)
source
=
Column
(
String
(
20
),
primary_key
=
True
,
nullable
=
False
)
...
@@ -545,14 +563,40 @@ class RiskStat(Base):
...
@@ -545,14 +563,40 @@ class RiskStat(Base):
exposure
=
Column
(
Float
(
53
))
exposure
=
Column
(
Float
(
53
))
class
SecurityMaster
(
Base
):
__tablename__
=
'security_master'
exchangeCD
=
Column
(
String
(
4
))
ListSectorCD
=
Column
(
BigInteger
)
ListSector
=
Column
(
String
(
6
))
transCurrCD
=
Column
(
Text
)
secShortName
=
Column
(
String
(
10
))
secFullName
=
Column
(
Text
)
listStatusCD
=
Column
(
String
(
2
))
listDate
=
Column
(
DateTime
)
delistDate
=
Column
(
DateTime
)
equTypeCD
=
Column
(
String
(
4
))
equType
=
Column
(
String
(
10
))
exCountryCD
=
Column
(
String
(
3
))
partyID
=
Column
(
BigInteger
)
totalShares
=
Column
(
Float
(
53
))
nonrestFloatShares
=
Column
(
Float
(
53
))
nonrestfloatA
=
Column
(
Float
(
53
))
officeAddr
=
Column
(
Text
)
primeOperating
=
Column
(
Text
)
endDate
=
Column
(
DateTime
)
TShEquity
=
Column
(
Float
(
53
))
code
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
class
SpecificReturn
(
Base
):
class
SpecificReturn
(
Base
):
__tablename__
=
'specific_return'
__tablename__
=
'specific_return'
__table_args__
=
(
__table_args__
=
(
Index
(
'specific_return_Date_Code_uindex'
,
'
Date'
,
'C
ode'
,
unique
=
True
),
Index
(
'specific_return_Date_Code_uindex'
,
'
trade_date'
,
'c
ode'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
C
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
c
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
exchangeCD
=
Column
(
String
(
4
))
exchangeCD
=
Column
(
String
(
4
))
secShortName
=
Column
(
String
(
20
))
secShortName
=
Column
(
String
(
20
))
spret
=
Column
(
Float
(
53
))
spret
=
Column
(
Float
(
53
))
...
@@ -562,11 +606,11 @@ class SpecificReturn(Base):
...
@@ -562,11 +606,11 @@ class SpecificReturn(Base):
class
SpecificRiskDay
(
Base
):
class
SpecificRiskDay
(
Base
):
__tablename__
=
'specific_risk_day'
__tablename__
=
'specific_risk_day'
__table_args__
=
(
__table_args__
=
(
Index
(
'specific_risk_day_Date_Code_uindex'
,
'
Date'
,
'C
ode'
,
unique
=
True
),
Index
(
'specific_risk_day_Date_Code_uindex'
,
'
trade_date'
,
'c
ode'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
C
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
c
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
exchangeCD
=
Column
(
String
(
4
))
exchangeCD
=
Column
(
String
(
4
))
secShortName
=
Column
(
String
(
20
))
secShortName
=
Column
(
String
(
20
))
SRISK
=
Column
(
Float
(
53
))
SRISK
=
Column
(
Float
(
53
))
...
@@ -576,11 +620,11 @@ class SpecificRiskDay(Base):
...
@@ -576,11 +620,11 @@ class SpecificRiskDay(Base):
class
SpecificRiskLong
(
Base
):
class
SpecificRiskLong
(
Base
):
__tablename__
=
'specific_risk_long'
__tablename__
=
'specific_risk_long'
__table_args__
=
(
__table_args__
=
(
Index
(
'specific_risk_long_Date_Code_uindex'
,
'
Date'
,
'C
ode'
,
unique
=
True
),
Index
(
'specific_risk_long_Date_Code_uindex'
,
'
trade_date'
,
'c
ode'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
C
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
c
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
exchangeCD
=
Column
(
String
(
4
))
exchangeCD
=
Column
(
String
(
4
))
secShortName
=
Column
(
String
(
20
))
secShortName
=
Column
(
String
(
20
))
updateTime
=
Column
(
DateTime
)
updateTime
=
Column
(
DateTime
)
...
@@ -590,11 +634,11 @@ class SpecificRiskLong(Base):
...
@@ -590,11 +634,11 @@ class SpecificRiskLong(Base):
class
SpecificRiskShort
(
Base
):
class
SpecificRiskShort
(
Base
):
__tablename__
=
'specific_risk_short'
__tablename__
=
'specific_risk_short'
__table_args__
=
(
__table_args__
=
(
Index
(
'specific_risk_short_Date_Code_uindex'
,
'
Date'
,
'C
ode'
,
unique
=
True
),
Index
(
'specific_risk_short_Date_Code_uindex'
,
'
trade_date'
,
'c
ode'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
C
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
c
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
exchangeCD
=
Column
(
String
(
4
))
exchangeCD
=
Column
(
String
(
4
))
secShortName
=
Column
(
String
(
20
))
secShortName
=
Column
(
String
(
20
))
SRISK
=
Column
(
Float
(
53
))
SRISK
=
Column
(
Float
(
53
))
...
@@ -604,10 +648,10 @@ class SpecificRiskShort(Base):
...
@@ -604,10 +648,10 @@ class SpecificRiskShort(Base):
class
Strategy
(
Base
):
class
Strategy
(
Base
):
__tablename__
=
'strategy'
__tablename__
=
'strategy'
__table_args__
=
(
__table_args__
=
(
Index
(
'strategy_Date_strategyName_factor_uindex'
,
'
D
ate'
,
'strategyName'
,
'factor'
,
unique
=
True
),
Index
(
'strategy_Date_strategyName_factor_uindex'
,
'
trade_d
ate'
,
'strategyName'
,
'factor'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
strategyName
=
Column
(
String
(
20
),
primary_key
=
True
,
nullable
=
False
)
strategyName
=
Column
(
String
(
20
),
primary_key
=
True
,
nullable
=
False
)
factor
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
factor
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
weight
=
Column
(
Float
(
53
))
weight
=
Column
(
Float
(
53
))
...
@@ -617,12 +661,12 @@ class Strategy(Base):
...
@@ -617,12 +661,12 @@ class Strategy(Base):
class
Tiny
(
Base
):
class
Tiny
(
Base
):
__tablename__
=
'tiny'
__tablename__
=
'tiny'
Date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
,
server_default
=
text
(
"(NULL)"
)
)
trade_date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
Code
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
,
server_default
=
text
(
"(NULL)"
)
)
code
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
CFinc1
=
Column
(
Float
(
53
)
,
server_default
=
text
(
"(NULL)"
)
)
CFinc1
=
Column
(
Float
(
53
))
BDTO
=
Column
(
Float
(
53
)
,
server_default
=
text
(
"(NULL)"
)
)
BDTO
=
Column
(
Float
(
53
))
RVOL
=
Column
(
Float
(
53
)
,
server_default
=
text
(
"(NULL)"
)
)
RVOL
=
Column
(
Float
(
53
))
CHV
=
Column
(
Float
(
53
)
,
server_default
=
text
(
"(NULL)"
)
)
CHV
=
Column
(
Float
(
53
))
VAL
=
Column
(
Float
(
53
))
VAL
=
Column
(
Float
(
53
))
EPSAfterNonRecurring
=
Column
(
Float
(
53
))
EPSAfterNonRecurring
=
Column
(
Float
(
53
))
DivP
=
Column
(
Float
(
53
))
DivP
=
Column
(
Float
(
53
))
...
@@ -631,22 +675,22 @@ class Tiny(Base):
...
@@ -631,22 +675,22 @@ class Tiny(Base):
class
Universe
(
Base
):
class
Universe
(
Base
):
__tablename__
=
'universe'
__tablename__
=
'universe'
__table_args__
=
(
__table_args__
=
(
Index
(
'universe_Date_universe_Code_uindex'
,
'
Date'
,
'universe'
,
'C
ode'
,
unique
=
True
),
Index
(
'universe_Date_universe_Code_uindex'
,
'
trade_date'
,
'universe'
,
'c
ode'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
C
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
c
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
universe
=
Column
(
String
(
20
),
primary_key
=
True
,
nullable
=
False
)
universe
=
Column
(
String
(
20
),
primary_key
=
True
,
nullable
=
False
)
class
Uqer
(
Base
):
class
Uqer
(
Base
):
__tablename__
=
'uqer'
__tablename__
=
'uqer'
__table_args__
=
(
__table_args__
=
(
Index
(
'factors_Date_Code_uindex'
,
'
Date'
,
'C
ode'
,
unique
=
True
),
Index
(
'factors_Date_Code_uindex'
,
'
trade_date'
,
'c
ode'
,
unique
=
True
),
)
)
D
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_d
ate
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
C
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
c
ode
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
AccountsPayablesTDays
=
Column
(
Float
(
53
))
AccountsPayablesTDays
=
Column
(
Float
(
53
))
AccountsPayablesTRate
=
Column
(
Float
(
53
))
AccountsPayablesTRate
=
Column
(
Float
(
53
))
AdminiExpenseRate
=
Column
(
Float
(
53
))
AdminiExpenseRate
=
Column
(
Float
(
53
))
...
@@ -1073,50 +1117,6 @@ class Uqer(Base):
...
@@ -1073,50 +1117,6 @@ class Uqer(Base):
NLSIZE
=
Column
(
Float
(
53
))
NLSIZE
=
Column
(
Float
(
53
))
class
SecurityMaster
(
Base
):
__tablename__
=
'security_master'
exchangeCD
=
Column
(
String
(
4
))
ListSectorCD
=
Column
(
BigInteger
)
ListSector
=
Column
(
String
(
6
))
transCurrCD
=
Column
(
Text
())
secShortName
=
Column
(
String
(
10
))
secFullName
=
Column
(
Text
())
listStatusCD
=
Column
(
String
(
2
))
listDate
=
Column
(
DateTime
)
delistDate
=
Column
(
DateTime
)
equTypeCD
=
Column
(
String
(
4
))
equType
=
Column
(
String
(
10
))
exCountryCD
=
Column
(
String
(
3
))
partyID
=
Column
(
BigInteger
)
totalShares
=
Column
(
Float
(
53
))
nonrestFloatShares
=
Column
(
Float
(
53
))
nonrestfloatA
=
Column
(
Float
(
53
))
officeAddr
=
Column
(
Text
())
primeOperating
=
Column
(
Text
())
endDate
=
Column
(
DateTime
)
TShEquity
=
Column
(
Float
(
53
))
Code
=
Column
(
Integer
,
primary_key
=
True
)
class
QuantileAnalysis
(
Base
):
__tablename__
=
'quantile_analysis'
Date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
portfolio
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
universe
=
Column
(
String
(
20
),
primary_key
=
True
,
nullable
=
False
)
benchmark
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
q1
=
Column
(
Float
(
53
))
q2
=
Column
(
Float
(
53
))
q3
=
Column
(
Float
(
53
))
q4
=
Column
(
Float
(
53
))
q5
=
Column
(
Float
(
53
))
q6
=
Column
(
Float
(
53
))
q7
=
Column
(
Float
(
53
))
q8
=
Column
(
Float
(
53
))
q9
=
Column
(
Float
(
53
))
q10
=
Column
(
Float
(
53
))
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
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