add 加入资金流向特大的标地

This commit is contained in:
yanweidong
2026-02-12 20:29:02 +08:00
parent 8de6c2a23a
commit c4fb37761b
6 changed files with 64 additions and 36 deletions

View File

@@ -86,8 +86,8 @@ func Report() {
})
}
// 3.判断盈亏超过20%,才确定平仓
if pnlRate >= 20 {
// 3.判断盈亏超过10%,才确定平仓
if pnlRate >= 10 {
impl.DBService.Model(&models.MockPosition{}).Where("id=?", p.ID).Updates(map[string]any{
"close_price": newClosePrice,
"pnl": pnl,

View File

@@ -3,6 +3,7 @@ package restful
import (
"log"
"git.apinb.com/quant/gostock/internal/impl"
"git.apinb.com/quant/gostock/internal/logic/mock"
"git.apinb.com/quant/gostock/internal/logic/strategy"
"git.apinb.com/quant/gostock/internal/logic/strategy/rule"
@@ -33,10 +34,16 @@ func Starter(ctx *gin.Context) {
model.AiScore = -2
model.AddDesc("无需AI分析")
}
}
model.Save()
}
// 加入资金流向特大的标地
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.StratModel{}).Where("ai_score=-2 and code in ?", codes).Update("ai_score", 0)
strategy.BootAiStart("selector", ymd)
log.Println("Strategy END.")
mock.Run("selector", ymd)

View File

@@ -36,7 +36,7 @@ func AiAnalysis(code string) (map[string]any, error) {
prompt += string(content)
chatReq := &request.ChatCompletionsRequest{
Model: deepseek.DEEPSEEK_REASONER_MODEL,
Model: deepseek.DEEPSEEK_CHAT_MODEL,
Stream: false,
Messages: []*request.Message{
{