代码拉取完成,页面将自动刷新
package tracker
import (
"fmt"
"gitee.com/quant1x/engine/factors"
"gitee.com/quant1x/engine/models"
"gitee.com/quant1x/gotdx/securities"
"gitee.com/quant1x/gox/api"
"gitee.com/quant1x/gox/progressbar"
"gitee.com/quant1x/num"
)
// 板块扫描
func scanSectorSnapshots(pbarIndex *int, blockType securities.BlockType) (list []factors.QuoteSnapshot) {
// 执行板块指数的检测
blockInfos := securities.BlockList()
// 获取指定类型的板块代码列表
var blockCodes []string
for _, v := range blockInfos {
if v.Type != blockType {
continue
}
blockCode := v.Code
blockCodes = append(blockCodes, blockCode)
blockTypeName, _ := securities.BlockTypeNameByTypeCode(v.Type)
__mapBlockTypeName[blockCode] = blockTypeName
}
blockCount := len(blockCodes)
fmt.Println()
btn, ok := securities.BlockTypeNameByTypeCode(blockType)
if !ok {
btn = num.AnyToString(blockType)
}
bar := progressbar.NewBar(*pbarIndex, "执行[扫描"+btn+"板块指数]", blockCount)
*pbarIndex++
for i := 0; i < blockCount; i++ {
bar.Add(1)
blockCode := blockCodes[i]
snapshot := models.GetStrategySnapshot(blockCode)
if snapshot == nil {
continue
}
list = append(list, *snapshot)
}
api.SliceSort(list, SectorSort)
return list
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。