2 Star 7 Fork 11

王布衣/engine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
feature_f10_reports.go 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
package factors
import (
"gitee.com/quant1x/engine/cache"
"gitee.com/quant1x/engine/datasets/dfcf"
"gitee.com/quant1x/gotdx/proto"
"gitee.com/quant1x/gox/api"
"gitee.com/quant1x/gox/logger"
)
var (
__mapQuarterlyReports = map[string]dfcf.QuarterlyReport{}
)
func loadQuarterlyReports(date string) {
var allReports []dfcf.QuarterlyReport
_, qEnd := api.GetQuarterDayByDate(date)
filename := cache.ReportsFilename(qEnd)
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, date string) quarterlyReportSummary {
var summary quarterlyReportSummary
if proto.AssertIndexBySecurityCode(securityCode) {
return summary
}
v, ok := __mapQuarterlyReports[securityCode]
if ok {
summary.BPS = v.BPS
summary.BasicEPS = v.BasicEPS
return summary
}
q := dfcf.GetCacheQuarterlyReportsBySecurityCode(securityCode, date)
if q != nil {
summary.BPS = q.BPS
summary.BasicEPS = q.BasicEPS
}
return summary
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/quant1x/engine.git
git@gitee.com:quant1x/engine.git
quant1x
engine
engine
v0.6.5

搜索帮助