add 加入资金流向特大的标地
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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{
|
||||
{
|
||||
|
||||
17
internal/models/money_total.go
Normal file
17
internal/models/money_total.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package models
|
||||
|
||||
// 资金流数据模型
|
||||
type MoneyTotal struct {
|
||||
ID uint `gorm:"primarykey"`
|
||||
Code string // 股票代码
|
||||
Last1DayMfAmount float64 // 最近1天净流入额(万元)
|
||||
Last3DayMfAmount float64 // 最近3天净流入额(万元)
|
||||
Last1DayTotalAmount float64 // 最近1天中大单总流入额(万元)
|
||||
Last3DayTotalAmount float64 // 最近3天中大单总流入额(万元)
|
||||
IsGreaterPervious bool // 是否比上一日大单流入额多
|
||||
}
|
||||
|
||||
// TableName 设置表名
|
||||
func (MoneyTotal) TableName() string {
|
||||
return "money_total"
|
||||
}
|
||||
Reference in New Issue
Block a user