fix bug
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user