fix bug
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user