2 Star 7 Fork 10

王布衣/engine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
feature_f10_capital.go 907 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2023-10-11 09:21 . 数据插件增加get接口
package factors
import (
"gitee.com/quant1x/engine/datasets/dfcf"
)
// ComputeFreeCapital 计算自由流通股本
func ComputeFreeCapital(holderList []dfcf.CirculatingShareholder, capital float64) (top10Capital, freeCapital, capitalChanged, increaseRatio, reductionRatio float64) {
increase := 0
reduce := 0
for k, holder := range holderList {
top10Capital += float64(holder.HoldNum)
capitalChanged += float64(holder.HoldNumChange)
if holder.HoldNumChange >= 0 {
increase += holder.HoldNumChange
} else {
reduce += holder.HoldNumChange
}
if k >= 10 {
continue
}
if holder.FreeHoldNumRatio >= 1.00 && holder.IsHoldOrg == "1" {
capital -= float64(holder.HoldNum)
}
}
increaseRatio = 100.0000 * (float64(increase) / top10Capital)
reductionRatio = 100.0000 * (float64(reduce) / top10Capital)
return top10Capital, capital, capitalChanged, increaseRatio, reductionRatio
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/quant1x/engine.git
git@gitee.com:quant1x/engine.git
quant1x
engine
engine
v0.8.5

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385