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
366b0936
Commit
366b0936
authored
Jul 17, 2017
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update models
parent
e5dc9c53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
127 additions
and
24 deletions
+127
-24
models.py
alphamind/data/dbmodel/models.py
+127
-24
No files found.
alphamind/data/dbmodel/models.py
View file @
366b0936
...
@@ -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
from
sqlalchemy
import
BigInteger
,
Column
,
DateTime
,
Float
,
Index
,
Integer
,
String
,
T
able
,
T
ext
,
text
from
sqlalchemy.ext.declarative
import
declarative_base
from
sqlalchemy.ext.declarative
import
declarative_base
...
@@ -27,25 +27,25 @@ class DailyReturn(Base):
...
@@ -27,25 +27,25 @@ class DailyReturn(Base):
class
FactorMaster
(
Base
):
class
FactorMaster
(
Base
):
__tablename__
=
'factor_master'
__tablename__
=
'factor_master'
__table_args__
=
(
__table_args__
=
(
Index
(
'factor_m
eta_factor_source_pk
'
,
'factor'
,
'source'
,
unique
=
True
),
Index
(
'factor_m
aster_factor_source_uindex
'
,
'factor'
,
'source'
,
unique
=
True
),
)
)
factor
=
Column
(
String
(
30
,
'utf8_general_ci'
),
nullable
=
False
)
factor
=
Column
(
String
(
30
,
'utf8_general_ci'
),
primary_key
=
True
,
nullable
=
False
)
source
=
Column
(
String
(
30
,
'utf8_general_ci'
),
nullable
=
False
)
source
=
Column
(
String
(
30
,
'utf8_general_ci'
),
primary_key
=
True
,
nullable
=
False
)
alias
=
Column
(
String
(
50
,
'utf8_general_ci'
),
primary_key
=
Tru
e
)
alias
=
Column
(
String
(
50
,
'utf8_general_ci'
),
nullable
=
Fals
e
)
updateTime
=
Column
(
DateTime
,
nullable
=
False
)
updateTime
=
Column
(
DateTime
)
description
=
Column
(
Text
(
2147483647
,
'utf8_general_ci'
))
description
=
Column
(
Text
(
2147483647
,
'utf8_general_ci'
))
class
HaltList
(
Base
):
class
HaltList
(
Base
):
__tablename__
=
'halt_list'
__tablename__
=
'halt_list'
__table_args__
=
(
__table_args__
=
(
Index
(
'halt_list_Date_Code_
uindex'
,
'Date'
,
'Cod
e'
,
unique
=
True
),
Index
(
'halt_list_Date_Code_
haltBeginTime_uindex'
,
'Date'
,
'Code'
,
'haltBeginTim
e'
,
unique
=
True
),
)
)
Date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
Date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
Code
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
Code
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
haltBeginTime
=
Column
(
DateTime
)
haltBeginTime
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
haltEndTime
=
Column
(
DateTime
)
haltEndTime
=
Column
(
DateTime
)
secShortName
=
Column
(
String
(
20
,
'utf8_general_ci'
))
secShortName
=
Column
(
String
(
20
,
'utf8_general_ci'
))
exchangeCD
=
Column
(
String
(
4
,
'utf8_general_ci'
))
exchangeCD
=
Column
(
String
(
4
,
'utf8_general_ci'
))
...
@@ -91,6 +91,82 @@ class Industry(Base):
...
@@ -91,6 +91,82 @@ class Industry(Base):
IndustryName4
=
Column
(
String
(
50
,
'utf8_general_ci'
))
IndustryName4
=
Column
(
String
(
50
,
'utf8_general_ci'
))
class
LegacyFactor
(
Base
):
__tablename__
=
'legacy_factor'
__table_args__
=
(
Index
(
'legacy_factor_Date_Code_uindex'
,
'Date'
,
'Code'
,
unique
=
True
),
)
Date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
Code
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
ROEAfterNonRecurring
=
Column
(
Float
(
53
))
EPSAfterNonRecurring
=
Column
(
Float
(
53
))
EODPrice
=
Column
(
Float
(
53
))
LogFloatCap
=
Column
(
Float
(
53
))
BPS
=
Column
(
Float
(
53
))
SPS
=
Column
(
Float
(
53
))
DebtToAsset
=
Column
(
Float
(
53
))
STOM
=
Column
(
Float
(
53
))
DROEAfterNonRecurring
=
Column
(
Float
(
53
))
LogTotalCap
=
Column
(
Float
(
53
))
BP
=
Column
(
Float
(
53
))
SP
=
Column
(
Float
(
53
))
EPAfterNonRecurring
=
Column
(
Float
(
53
))
DivToB
=
Column
(
Float
(
53
))
DivP
=
Column
(
Float
(
53
))
EBITToSales
=
Column
(
Float
(
53
))
EBITAToSales
=
Column
(
Float
(
53
))
EVToSales
=
Column
(
Float
(
53
))
EVToEBIT
=
Column
(
Float
(
53
))
EVToEBITDA
=
Column
(
Float
(
53
))
EVToNOPLAT
=
Column
(
Float
(
53
))
EVToIC
=
Column
(
Float
(
53
))
ROIC
=
Column
(
Float
(
53
))
FCFFPS
=
Column
(
Float
(
53
))
FCFFToEarningAfterNonRecurring
=
Column
(
Float
(
53
))
FCFFP
=
Column
(
Float
(
53
))
ProfitToAsset
=
Column
(
Float
(
53
))
GrossProfitRatio
=
Column
(
Float
(
53
))
NetProfitRatio
=
Column
(
Float
(
53
))
LATO
=
Column
(
Float
(
53
))
FATO
=
Column
(
Float
(
53
))
TATO
=
Column
(
Float
(
53
))
EquityTO
=
Column
(
Float
(
53
))
PayableTO
=
Column
(
Float
(
53
))
RecievableTO
=
Column
(
Float
(
53
))
RevenueGrowth
=
Column
(
Float
(
53
))
GrossProfitGrowth
=
Column
(
Float
(
53
))
NetProfitGrowth
=
Column
(
Float
(
53
))
GrossCFToRevenue
=
Column
(
Float
(
53
))
CFToRevenue
=
Column
(
Float
(
53
))
CFToProfit
=
Column
(
Float
(
53
))
CFToAsset
=
Column
(
Float
(
53
))
GrossCFGrowth
=
Column
(
Float
(
53
))
CFGrowth
=
Column
(
Float
(
53
))
ICFGrowth
=
Column
(
Float
(
53
))
AveAmount60
=
Column
(
Float
(
53
))
PeriodReturn60
=
Column
(
Float
(
53
))
AmountRatio60to250
=
Column
(
Float
(
53
))
CFPS
=
Column
(
Float
(
53
))
CFP
=
Column
(
Float
(
53
))
NetCFGrowth
=
Column
(
Float
(
53
))
NetCFGrowthP
=
Column
(
Float
(
53
))
NetCash
=
Column
(
Float
(
53
))
NetCashP
=
Column
(
Float
(
53
))
BVPSGrowth
=
Column
(
Float
(
53
))
EquityPSGrowth
=
Column
(
Float
(
53
))
WholeSales
=
Column
(
Float
(
53
))
WholeProfitAfterNonRecurring
=
Column
(
Float
(
53
))
ExpenseRatio
=
Column
(
Float
(
53
))
CurrentRatio
=
Column
(
Float
(
53
))
QuickRatio
=
Column
(
Float
(
53
))
AcidTestRatio
=
Column
(
Float
(
53
))
TimeInterestEarnedRatio
=
Column
(
Float
(
53
))
DepositReceivedVsSale
=
Column
(
Float
(
53
))
DebtRatioExcemptDepRec
=
Column
(
Float
(
53
))
SNBARatio
=
Column
(
Float
(
53
))
class
Market
(
Base
):
class
Market
(
Base
):
__tablename__
=
'market'
__tablename__
=
'market'
__table_args__
=
(
__table_args__
=
(
...
@@ -107,9 +183,9 @@ class Market(Base):
...
@@ -107,9 +183,9 @@ class Market(Base):
highestPrice
=
Column
(
Float
(
53
))
highestPrice
=
Column
(
Float
(
53
))
lowestPrice
=
Column
(
Float
(
53
))
lowestPrice
=
Column
(
Float
(
53
))
closePrice
=
Column
(
Float
(
53
))
closePrice
=
Column
(
Float
(
53
))
turnoverVol
=
Column
(
Integer
)
turnoverVol
=
Column
(
Big
Integer
)
turnoverValue
=
Column
(
Float
(
53
))
turnoverValue
=
Column
(
Float
(
53
))
dealAmount
=
Column
(
Integer
)
dealAmount
=
Column
(
Big
Integer
)
turnoverRate
=
Column
(
Float
(
53
))
turnoverRate
=
Column
(
Float
(
53
))
accumAdjFactor
=
Column
(
Float
(
53
))
accumAdjFactor
=
Column
(
Float
(
53
))
negMarketValue
=
Column
(
Float
(
53
))
negMarketValue
=
Column
(
Float
(
53
))
...
@@ -139,6 +215,25 @@ class Performance(Base):
...
@@ -139,6 +215,25 @@ class Performance(Base):
ic
=
Column
(
Float
(
53
))
ic
=
Column
(
Float
(
53
))
class
Performance2
(
Base
):
__tablename__
=
'performance2'
__table_args__
=
(
Index
(
'performance2_Date_type_portfolio_industry_source_universe_uindex'
,
'Date'
,
'type'
,
'portfolio'
,
'industry'
,
'source'
,
'universe'
,
'benchmark'
,
unique
=
True
),
Index
(
'performance2_type_industry_universe_portfolio_index'
,
'type'
,
'industry'
,
'universe'
,
'portfolio'
)
)
Date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
type
=
Column
(
String
(
20
,
'utf8_general_ci'
),
primary_key
=
True
,
nullable
=
False
)
portfolio
=
Column
(
String
(
50
,
'utf8_general_ci'
),
primary_key
=
True
,
nullable
=
False
)
industry
=
Column
(
String
(
50
,
'utf8_general_ci'
),
primary_key
=
True
,
nullable
=
False
)
source
=
Column
(
String
(
20
,
'utf8_general_ci'
),
primary_key
=
True
,
nullable
=
False
)
universe
=
Column
(
String
(
50
,
'utf8_general_ci'
),
primary_key
=
True
,
nullable
=
False
)
benchmark
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
er
=
Column
(
Float
(
53
),
nullable
=
False
)
turn_over
=
Column
(
Float
(
53
))
ic
=
Column
(
Float
(
53
))
class
RiskCovDay
(
Base
):
class
RiskCovDay
(
Base
):
__tablename__
=
'risk_cov_day'
__tablename__
=
'risk_cov_day'
__table_args__
=
(
__table_args__
=
(
...
@@ -194,8 +289,8 @@ class RiskCovDay(Base):
...
@@ -194,8 +289,8 @@ 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_Factor
_uindex'
,
'Date'
,
'Factor
'
,
unique
=
True
),
Index
(
'risk_cov_long_Date_Factor
ID_uindex'
,
'Date'
,
'FactorID
'
,
unique
=
True
),
Index
(
'risk_cov_long_Date_Factor
ID_uindex'
,
'Date'
,
'FactorID
'
,
unique
=
True
)
Index
(
'risk_cov_long_Date_Factor
_uindex'
,
'Date'
,
'Factor
'
,
unique
=
True
)
)
)
Date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
Date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
...
@@ -246,8 +341,8 @@ class RiskCovLong(Base):
...
@@ -246,8 +341,8 @@ 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_Factor
ID_uindex'
,
'Date'
,
'FactorID
'
,
unique
=
True
),
Index
(
'risk_cov_short_Date_Factor
_uindex'
,
'Date'
,
'Factor
'
,
unique
=
True
),
Index
(
'risk_cov_short_Date_Factor
_uindex'
,
'Date'
,
'Factor
'
,
unique
=
True
)
Index
(
'risk_cov_short_Date_Factor
ID_uindex'
,
'Date'
,
'FactorID
'
,
unique
=
True
)
)
)
Date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
Date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
...
@@ -347,6 +442,18 @@ class RiskExposure(Base):
...
@@ -347,6 +442,18 @@ class RiskExposure(Base):
updateTime
=
Column
(
DateTime
)
updateTime
=
Column
(
DateTime
)
t_risk_master
=
Table
(
'risk_master'
,
metadata
,
Column
(
'factor'
,
String
(
30
,
'utf8_general_ci'
),
nullable
=
False
),
Column
(
'source'
,
String
(
30
,
'utf8_general_ci'
),
nullable
=
False
),
Column
(
'alias'
,
String
(
30
,
'utf8_general_ci'
),
nullable
=
False
),
Column
(
'type'
,
String
(
30
,
'utf8_general_ci'
)),
Column
(
'updateTime'
,
DateTime
),
Column
(
'description'
,
Text
(
2147483647
,
'utf8_general_ci'
)),
Column
(
'factor_id'
,
Integer
,
nullable
=
False
)
)
class
RiskReturn
(
Base
):
class
RiskReturn
(
Base
):
__tablename__
=
'risk_return'
__tablename__
=
'risk_return'
...
@@ -465,16 +572,12 @@ class Strategy(Base):
...
@@ -465,16 +572,12 @@ class Strategy(Base):
class
Tiny
(
Base
):
class
Tiny
(
Base
):
__tablename__
=
'tiny'
__tablename__
=
'tiny'
__table_args__
=
(
Date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
,
server_default
=
text
(
"(NULL)"
))
Index
(
'tiny_Date_Code_uindex'
,
'Date'
,
'Code'
,
unique
=
True
),
Code
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
,
server_default
=
text
(
"(NULL)"
))
)
CFinc1
=
Column
(
Float
(
53
),
server_default
=
text
(
"(NULL)"
))
BDTO
=
Column
(
Float
(
53
),
server_default
=
text
(
"(NULL)"
))
Date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
RVOL
=
Column
(
Float
(
53
),
server_default
=
text
(
"(NULL)"
))
Code
=
Column
(
Integer
,
primary_key
=
True
,
nullable
=
False
)
CHV
=
Column
(
Float
(
53
),
server_default
=
text
(
"(NULL)"
))
CFinc1
=
Column
(
Float
(
53
))
BDTO
=
Column
(
Float
(
53
))
RVOL
=
Column
(
Float
(
53
))
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
))
...
...
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