代码拉取完成,页面将自动刷新
package factors
import (
"gitee.com/quant1x/engine/datasource/base"
"gitee.com/quant1x/engine/datasource/dfcf"
"gitee.com/quant1x/exchange"
"gitee.com/quant1x/gotdx/quotes"
"gitee.com/quant1x/gox/api"
)
type top10ShareHolder struct {
Code string
FreeCapital float64
Top10Capital float64
Top10Change float64
ChangeCapital float64
IncreaseRatio float64
ReductionRatio float64
}
func checkoutShareHolder(securityCode, featureDate string) *top10ShareHolder {
xdxrs := base.GetCacheXdxrList(securityCode)
api.SliceSort(xdxrs, func(a, b quotes.XdxrInfo) bool {
return a.Date > b.Date
})
xdxrInfo := checkoutCapital(xdxrs, featureDate)
if xdxrInfo != nil && exchange.AssertStockBySecurityCode(securityCode) {
list := dfcf.GetCacheShareHolder(securityCode, featureDate)
capital := xdxrInfo.HouLiuTong * 10000
totalCapital := xdxrInfo.HouZongGuBen * 10000
top10Capital, freeCapital, capitalChanged, increaseRatio, reductionRatio := ComputeFreeCapital(list, capital)
if freeCapital < 0 {
top10Capital, freeCapital, capitalChanged, increaseRatio, reductionRatio = ComputeFreeCapital(list, totalCapital)
}
frontList := dfcf.GetCacheShareHolder(securityCode, featureDate, 2)
frontTop10Capital, _, _, _, _ := ComputeFreeCapital(frontList, totalCapital)
shareHolder := top10ShareHolder{
Code: securityCode,
FreeCapital: freeCapital,
Top10Capital: top10Capital,
Top10Change: top10Capital - frontTop10Capital,
ChangeCapital: capitalChanged,
IncreaseRatio: increaseRatio,
ReductionRatio: reductionRatio,
}
return &shareHolder
}
return nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。