This commit is contained in:
yanweidong
2026-02-13 01:23:27 +08:00
parent 729301c771
commit 0a0ae07a32

View File

@@ -19,15 +19,22 @@ func Starter(ctx *gin.Context) {
model := models.NewStratModel("selector", code, ymd) model := models.NewStratModel("selector", code, ymd)
stratRule := rule.NewRule(model) stratRule := rule.NewRule(model)
{ {
// 规则:上市时间
stratRule.RunUpDate(strategy.Cache[code].Basic.ListDate) stratRule.RunUpDate(strategy.Cache[code].Basic.ListDate)
// 规则是否是ST
stratRule.RunST(strategy.Cache[code].Basic.Name) stratRule.RunST(strategy.Cache[code].Basic.Name)
// 规则:行业,剔除夕阳和中性行业
stratRule.RunIndustry(strategy.Cache[code].Basic.Industry) stratRule.RunIndustry(strategy.Cache[code].Basic.Industry)
// 规则最近20天每天最低价高于5元
stratRule.RunPrice(code) stratRule.RunPrice(code)
// 规则每天交易额超过10亿
stratRule.RunAmount(code) stratRule.RunAmount(code)
// 规则ROE 市盈率必须为正
stratRule.RunRoe(code) stratRule.RunRoe(code)
// 规则RSI指标贴近下轨并成上涨趋势
stratRule.RunRsi(code) stratRule.RunRsi(code)
// 过滤无需AI分析 // 满足以上规则在让Deepseek分析
if model.UpDateDay > 180 && model.StScore > 0 && model.IndustryScore > 1 && model.GtPrice > 0 && model.GtAmount > 0 && model.GtRoe > 0 && model.ScoreRsi > 0 { if model.UpDateDay > 180 && model.StScore > 0 && model.IndustryScore > 1 && model.GtPrice > 0 && model.GtAmount > 0 && model.GtRoe > 0 && model.ScoreRsi > 0 {
model.AiScore = 0 // 待分析 model.AiScore = 0 // 待分析
model.RecommendDesc = "Rule规则" model.RecommendDesc = "Rule规则"
@@ -40,11 +47,14 @@ func Starter(ctx *gin.Context) {
model.Save() model.Save()
} }
// 加入资金流向特大的标 // 加入资金流向特大的标
var codes []string var codes []string
impl.DBService.Model(&models.MoneyTotal{}).Where("is_greater_pervious = ? and last3_day_mf_amount>?", true, 100000).Pluck("code", &codes) impl.DBService.Model(&models.MoneyTotal{}).Where("is_greater_pervious = ? and last3_day_mf_amount>?", true, 100000).Pluck("code", &codes)
impl.DBService.Model(&models.StratModel{}).Where("ai_score=-2 and code in ?", codes).Updates(map[string]any{"ai_score": 0, "recommend_desc": "资金流向"}) impl.DBService.Model(&models.StratModel{}).Where("ai_score=-2 and code in ?", codes).Updates(map[string]any{"ai_score": 0, "recommend_desc": "资金流向"})
// Todo: 舆论分析得出的标的
// AI分析根据基本资料过去200交易日的数据200日的财务指标3年周报给出得分
strategy.BootAiStart("selector", ymd) strategy.BootAiStart("selector", ymd)
log.Println("Strategy END.") log.Println("Strategy END.")
mock.Run("selector", ymd) mock.Run("selector", ymd)