This commit is contained in:
yanweidong
2026-02-03 19:56:22 +08:00
parent f040b969e4
commit 815fa9db1a
2 changed files with 6 additions and 1 deletions

View File

@@ -36,7 +36,7 @@ func main() {
stratRule.RunRsi(code)
// 过滤无需AI分析
if model.StScore > 0 && model.IndustryScore > 0 && model.GtPrice > 0 && model.GtAmount > 0 && model.GtRoe > 0 {
if model.StScore > 0 && model.IndustryScore > 0 && model.GtPrice > 0 && model.GtAmount > 0 && model.GtRoe > 0 && model.ScoreRsi > 0 {
stratRule.RunAi(code)
} else {
model.AiScrore = -2

View File

@@ -10,6 +10,10 @@ import (
talib "github.com/markcheno/go-talib"
)
var (
offset = 3 // 偏移量
)
type StockArgConf struct {
BestByDrawdown string `json:"best_by_drawdown"`
BestByProfit string `json:"best_by_profit"`
@@ -57,6 +61,7 @@ func (r *RuleFactory) RunRsi(code string) {
}
newCloses := reverseSlice(close)
args.RsiOversold = args.RsiOversold + offset
rsiResult := talib.Rsi(newCloses, args.RsiPeriod)
prveRsi := utils.FloatRound(rsiResult[len(rsiResult)-2], 2)