fix bug
This commit is contained in:
@@ -36,7 +36,7 @@ func main() {
|
|||||||
stratRule.RunRsi(code)
|
stratRule.RunRsi(code)
|
||||||
|
|
||||||
// 过滤无需AI分析
|
// 过滤无需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)
|
stratRule.RunAi(code)
|
||||||
} else {
|
} else {
|
||||||
model.AiScrore = -2
|
model.AiScrore = -2
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ import (
|
|||||||
talib "github.com/markcheno/go-talib"
|
talib "github.com/markcheno/go-talib"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
offset = 3 // 偏移量
|
||||||
|
)
|
||||||
|
|
||||||
type StockArgConf struct {
|
type StockArgConf struct {
|
||||||
BestByDrawdown string `json:"best_by_drawdown"`
|
BestByDrawdown string `json:"best_by_drawdown"`
|
||||||
BestByProfit string `json:"best_by_profit"`
|
BestByProfit string `json:"best_by_profit"`
|
||||||
@@ -57,6 +61,7 @@ func (r *RuleFactory) RunRsi(code string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
newCloses := reverseSlice(close)
|
newCloses := reverseSlice(close)
|
||||||
|
args.RsiOversold = args.RsiOversold + offset
|
||||||
|
|
||||||
rsiResult := talib.Rsi(newCloses, args.RsiPeriod)
|
rsiResult := talib.Rsi(newCloses, args.RsiPeriod)
|
||||||
prveRsi := utils.FloatRound(rsiResult[len(rsiResult)-2], 2)
|
prveRsi := utils.FloatRound(rsiResult[len(rsiResult)-2], 2)
|
||||||
|
|||||||
Reference in New Issue
Block a user