mirror of
https://github.com/injoyai/tdx.git
synced 2025-11-26 21:25:35 +08:00
修改代码信息的字段PreClose,为LastClose,表示最新价(昨日收盘价,指数和基金有效,个股无效)
This commit is contained in:
@@ -15,7 +15,7 @@ type Code struct {
|
|||||||
Code string //股票代码
|
Code string //股票代码
|
||||||
Multiple uint16 //倍数,基本是0x64=100
|
Multiple uint16 //倍数,基本是0x64=100
|
||||||
Decimal int8 //小数点,基本是2
|
Decimal int8 //小数点,基本是2
|
||||||
PreClose float64 //未知
|
LastPrice float64 //昨收价格,单位元,对个股无效,对指数有效,对其他未知
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Code) String() string {
|
func (this *Code) String() string {
|
||||||
@@ -49,7 +49,7 @@ func (code) Decode(bs []byte) (*CodeResp, error) {
|
|||||||
Multiple: Uint16(bs[6:8]),
|
Multiple: Uint16(bs[6:8]),
|
||||||
Name: string(UTF8ToGBK(bs[8:16])),
|
Name: string(UTF8ToGBK(bs[8:16])),
|
||||||
Decimal: int8(bs[20]),
|
Decimal: int8(bs[20]),
|
||||||
PreClose: getVolume(Uint32(bs[21:25])),
|
LastPrice: getVolume(Uint32(bs[21:25])),
|
||||||
}
|
}
|
||||||
//logs.Debug(bs[25:29]) //26和28字节 好像是枚举(基本是44,45和34,35)
|
//logs.Debug(bs[25:29]) //26和28字节 好像是枚举(基本是44,45和34,35)
|
||||||
bs = bs[29:]
|
bs = bs[29:]
|
||||||
|
|||||||
Reference in New Issue
Block a user