This commit is contained in:
2026-02-25 23:07:10 +08:00
parent bb57a56634
commit f29265c0e4
3 changed files with 15 additions and 3 deletions

View File

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