67 lines
4.0 KiB
Go
67 lines
4.0 KiB
Go
package schema
|
||
|
||
import "strconv"
|
||
|
||
// DatasetIndicatorPro 对应 Tushare stk_factor_pro 当前请求字段集(见 tushare/indicator.go 的 fields 列表)。
|
||
type DatasetIndicatorPro struct {
|
||
ID uint `gorm:"primarykey;autoIncrement"`
|
||
TsCode string `gorm:"type:varchar(20);not null;index:dip_ts_code;uniqueIndex:un_dip_code_date;comment:股票代码" json:"ts_code"`
|
||
TradeDate int `gorm:"index:dip_trade_date;uniqueIndex:un_dip_code_date;comment:交易日期" json:"trade_date"`
|
||
Open float64 `gorm:"type:decimal(20,4);comment:开盘价"`
|
||
High float64 `gorm:"type:decimal(20,4);comment:最高价"`
|
||
Low float64 `gorm:"type:decimal(20,4);comment:最低价"`
|
||
Close float64 `gorm:"type:decimal(20,4);comment:收盘价"`
|
||
PreClose float64 `gorm:"type:decimal(20,4);comment:昨收价"`
|
||
Change float64 `gorm:"type:decimal(20,4);comment:涨跌额"`
|
||
PctChg float64 `gorm:"type:decimal(20,6);comment:涨跌幅%"`
|
||
Vol float64 `gorm:"type:decimal(20,2);comment:成交量(手)"`
|
||
Amount float64 `gorm:"type:decimal(20,2);comment:成交额(千元)"`
|
||
TurnoverRate float64 `gorm:"type:decimal(20,4);comment:换手率(%)"`
|
||
TurnoverRateF float64 `gorm:"type:decimal(20,4);comment:换手率(自由流通股)"`
|
||
VolumeRatio float64 `gorm:"type:decimal(20,4);comment:量比"`
|
||
Pe float64 `gorm:"type:decimal(20,4);comment:市盈率"`
|
||
PeTtm float64 `gorm:"type:decimal(20,4);comment:市盈率TTM"`
|
||
Pb float64 `gorm:"type:decimal(20,4);comment:市净率"`
|
||
Ps float64 `gorm:"type:decimal(20,4);comment:市销率"`
|
||
PsTtm float64 `gorm:"type:decimal(20,4);comment:市销率TTM"`
|
||
DvRatio float64 `gorm:"type:decimal(20,4);comment:股息率(%)"`
|
||
DvTtm float64 `gorm:"type:decimal(20,4);comment:股息率TTM(%)"`
|
||
TotalShare float64 `gorm:"type:decimal(20,4);comment:总股本(万股)"`
|
||
FloatShare float64 `gorm:"type:decimal(20,4);comment:流通股本(万股)"`
|
||
FreeShare float64 `gorm:"type:decimal(20,4);comment:自由流通股本(万股)"`
|
||
TotalMv float64 `gorm:"type:decimal(20,4);comment:总市值(万元)"`
|
||
CircMv float64 `gorm:"type:decimal(20,4);comment:流通市值(万元)"`
|
||
AdjFactor float64 `gorm:"type:decimal(20,6);comment:复权因子"`
|
||
MaBfq5 float64 `gorm:"type:decimal(20,6);comment:MA5不复权"`
|
||
MaBfq10 float64 `gorm:"type:decimal(20,6);comment:MA10不复权"`
|
||
MaBfq20 float64 `gorm:"type:decimal(20,6);comment:MA20不复权"`
|
||
MaBfq60 float64 `gorm:"type:decimal(20,6);comment:MA60不复权"`
|
||
EmaBfq5 float64 `gorm:"type:decimal(20,6);comment:EMA5不复权"`
|
||
EmaBfq10 float64 `gorm:"type:decimal(20,6);comment:EMA10不复权"`
|
||
EmaBfq20 float64 `gorm:"type:decimal(20,6);comment:EMA20不复权"`
|
||
MacdBfq float64 `gorm:"type:decimal(20,6);comment:MACD不复权"`
|
||
MacdDifBfq float64 `gorm:"type:decimal(20,6);comment:MACD DIF不复权"`
|
||
MacdDeaBfq float64 `gorm:"type:decimal(20,6);comment:MACD DEA不复权"`
|
||
RsiBfq6 float64 `gorm:"type:decimal(20,6);comment:RSI6不复权"`
|
||
RsiBfq12 float64 `gorm:"type:decimal(20,6);comment:RSI12不复权"`
|
||
RsiBfq24 float64 `gorm:"type:decimal(20,6);comment:RSI24不复权"`
|
||
KdjKBfq float64 `gorm:"type:decimal(20,6);comment:KDJ-K不复权"`
|
||
KdjDBfq float64 `gorm:"type:decimal(20,6);comment:KDJ-D不复权"`
|
||
KdjBfq float64 `gorm:"type:decimal(20,6);comment:KDJ-J不复权"`
|
||
BollUpperBfq float64 `gorm:"type:decimal(20,6);comment:BOLL上轨不复权"`
|
||
BollMidBfq float64 `gorm:"type:decimal(20,6);comment:BOLL中轨不复权"`
|
||
BollLowerBfq float64 `gorm:"type:decimal(20,6);comment:BOLL下轨不复权"`
|
||
}
|
||
|
||
func (DatasetIndicatorPro) TableName() string {
|
||
return "dataset_indicator_pro"
|
||
}
|
||
|
||
// Key 业务主键:ts_code + 交易日。
|
||
func (s *DatasetIndicatorPro) Key() string {
|
||
if s.TsCode == "" && s.TradeDate == 0 {
|
||
return ""
|
||
}
|
||
return s.TsCode + "#" + strconv.Itoa(s.TradeDate)
|
||
}
|