deving
This commit is contained in:
@@ -19,20 +19,22 @@ func (r *RuleFactory) RunRoe(code string) {
|
||||
var data models.StockFinaIndicator
|
||||
err := impl.DBService.Where("ts_code = ?", code).Order("period desc").Limit(1).First(&data).Error
|
||||
if err != nil {
|
||||
r.Model.GtAmount = -1
|
||||
r.Model.GtRoe = -1
|
||||
r.Model.ValRoe = -1
|
||||
r.Model.AddDesc("最近无财报,无ROE值!")
|
||||
return
|
||||
}
|
||||
|
||||
data.Roe = utils.FloatRound(data.Roe, 2)
|
||||
r.Model.ValRoe = data.Roe
|
||||
|
||||
if data.Roe < MinRoe {
|
||||
r.Model.GtAmount = -1
|
||||
r.Model.GtRoe = -1
|
||||
r.Model.AddDesc(fmt.Sprintf("ROE=%.2f 低于%.2f", data.Roe, MinRoe))
|
||||
return
|
||||
}
|
||||
|
||||
r.Model.GtAmount = 1
|
||||
r.Model.GtRoe = 1
|
||||
r.Model.AddDesc(fmt.Sprintf("ROE=%.2f 高于%.2f", data.Roe, MinRoe))
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user