f
This commit is contained in:
23
internal/logic/restful/recommend.go
Normal file
23
internal/logic/restful/recommend.go
Normal 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
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user