2 Star 7 Fork 11

王布衣/engine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
feature_f10_reports.go 917 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2023-10-11 09:21 . 数据插件增加get接口
package factors
import (
"gitee.com/quant1x/engine/cache"
"gitee.com/quant1x/engine/datasets/dfcf"
"gitee.com/quant1x/gox/api"
"gitee.com/quant1x/gox/logger"
)
var (
__mapQuarterlyReports = map[string]dfcf.QuarterlyReport{}
)
func loadQuarterlyReports(date string) {
var allReports []dfcf.QuarterlyReport
filename := cache.ReportsFilename(date)
err := api.CsvToSlices(filename, &allReports)
if err != nil {
logger.Errorf("cache %s failed, error: %+v", filename, err)
}
if len(allReports) > 0 {
for _, v := range allReports {
__mapQuarterlyReports[v.SecurityCode] = v
}
}
}
type quarterlyReportSummary struct {
BPS float64
BasicEPS float64
}
func getQuarterlyReportSummary(securityCode string) quarterlyReportSummary {
var summary quarterlyReportSummary
v, ok := __mapQuarterlyReports[securityCode]
if ok {
summary.BPS = v.BPS
summary.BasicEPS = v.BasicEPS
}
return summary
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/quant1x/engine.git
git@gitee.com:quant1x/engine.git
quant1x
engine
engine
v0.4.1

搜索帮助