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:复权因子"` MaQfq5 float64 `gorm:"type:decimal(20,6);comment:MA5前复权"` MaQfq10 float64 `gorm:"type:decimal(20,6);comment:MA10前复权"` MaQfq20 float64 `gorm:"type:decimal(20,6);comment:MA20前复权"` MaQfq60 float64 `gorm:"type:decimal(20,6);comment:MA60前复权"` EmaQfq5 float64 `gorm:"type:decimal(20,6);comment:EMA5前复权"` EmaQfq10 float64 `gorm:"type:decimal(20,6);comment:EMA10前复权"` EmaQfq20 float64 `gorm:"type:decimal(20,6);comment:EMA20前复权"` MacdQfq float64 `gorm:"type:decimal(20,6);comment:MACD前复权"` MacdDifQfq float64 `gorm:"type:decimal(20,6);comment:MACD DIF前复权"` MacdDeaQfq float64 `gorm:"type:decimal(20,6);comment:MACD DEA前复权"` RsiQfq6 float64 `gorm:"type:decimal(20,6);comment:RSI6前复权"` RsiQfq12 float64 `gorm:"type:decimal(20,6);comment:RSI12前复权"` RsiQfq24 float64 `gorm:"type:decimal(20,6);comment:RSI24前复权"` KdjKQfq float64 `gorm:"type:decimal(20,6);comment:KDJ-K前复权"` KdjDQfq float64 `gorm:"type:decimal(20,6);comment:KDJ-D前复权"` KdjQfq float64 `gorm:"type:decimal(20,6);comment:KDJ-J前复权"` BollUpperQfq float64 `gorm:"type:decimal(20,6);comment:BOLL上轨前复权"` BollMidQfq float64 `gorm:"type:decimal(20,6);comment:BOLL中轨前复权"` BollLowerQfq 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) }