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

@@ -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)