fix bug
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
func Run(key string, ymd int) {
|
||||
log.Println("Run Mock Order.")
|
||||
var stocks []*models.StratModel
|
||||
impl.DBService.Where("strat_key=? and ymd=? and rsi_score>0 and macd_score>0 ai_score>=?", key, ymd, 5).Find(&stocks)
|
||||
impl.DBService.Where("strat_key=? and ymd=? and rsi_score>0 and macd_score>0 and ai_score>=?", key, ymd, 5).Find(&stocks)
|
||||
if len(stocks) == 0 {
|
||||
log.Println("No data to process.")
|
||||
return
|
||||
@@ -98,3 +98,10 @@ func Report() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func IsPosition(code string) bool {
|
||||
var cnt int64
|
||||
impl.DBService.Model(&models.MockPosition{}).Where("code=? and status=0", code).Count(&cnt)
|
||||
|
||||
return cnt > 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user