2 Star 4 Fork 10

王布衣/engine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
subnew.go 730 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2024-01-11 11:15 . 适配exchange工具包
package market
import (
"gitee.com/quant1x/exchange"
"gitee.com/quant1x/gotdx/securities"
"sync"
)
const (
// 次新股板块
kBlockSubNewStock = "880529"
)
var (
onceSubNew sync.Once
mapSubnewStock = map[string]bool{}
)
func loadSubNewStock() {
blockInfo := securities.GetBlockInfo(kBlockSubNewStock)
if blockInfo == nil {
return
}
for _, v := range blockInfo.ConstituentStocks {
securityCode := exchange.CorrectSecurityCode(v)
mapSubnewStock[securityCode] = true
}
}
// IsSubNewStock 是否次新股
func IsSubNewStock(code string) bool {
onceSubNew.Do(loadSubNewStock)
securityCode := exchange.CorrectSecurityCode(code)
if v, ok := mapSubnewStock[securityCode]; ok {
return v
}
return false
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/quant1x/engine.git
git@gitee.com:quant1x/engine.git
quant1x
engine
engine
v1.7.4

搜索帮助

Cb406eda 1850385 E526c682 1850385