This commit is contained in:
2026-02-19 14:33:22 +08:00
parent 3090a60cf8
commit 5340b07795
9 changed files with 57 additions and 71 deletions

View File

@@ -0,0 +1,23 @@
package restful
import (
"git.apinb.com/quant/gostock/internal/impl"
"git.apinb.com/quant/gostock/internal/logic/strategy"
"git.apinb.com/quant/gostock/internal/models"
"github.com/gin-gonic/gin"
)
func Recommend(ctx *gin.Context) {
ymd := lastYmd()
strategy.TotalScore(ymd)
var stocks []string
impl.DBService.Model(&models.StratModel{}).Where("total_score>?", 0).Pluck("code", &stocks)
ctx.JSON(200, stocks)
return
}
func lastYmd() int {
var ymd int
sql := "select ymd from strat_model sm group by ymd order by ymd desc limit 1"
impl.DBService.Raw(sql).Scan(&ymd)
return ymd
}

View File

@@ -35,8 +35,9 @@ func Starter(ctx *gin.Context) {
stratRule.RunRsi(code)
// 满足以上规则在让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 > 360 && model.StScore > 0 && model.IndustryScore > 1 && model.GtPrice > 0 && model.GtAmount > 0 && model.GtRoe > 0 && model.ScoreRsi > 0 {
model.AiScore = 0 // 待分析
model.TotalScore = float64(model.IndustryScore + model.StScore + model.GtPrice + model.GtAmount + model.GtRoe + model.ScoreRsi)
model.RecommendDesc = "Rule规则"
} else {
model.AiScore = -2