2 Star 7 Fork 10

王布衣/engine

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
feature_f10_capital.go 909 Bytes
Copy Edit Raw Blame History
王布衣 authored 2023-12-20 07:47 . 统一数据到factors目录
package factors
import (
"gitee.com/quant1x/engine/datasource/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
v1.5.2

Search

23e8dbc6 1850385 7e0993f3 1850385