diff --git a/internal/logic/mock/order.go b/internal/logic/mock/order.go index 6300e34..bb0352f 100644 --- a/internal/logic/mock/order.go +++ b/internal/logic/mock/order.go @@ -9,6 +9,10 @@ import ( "git.apinb.com/quant/gostock/internal/models" ) +var ( + DefaultClosedPnl float64 = 9 +) + func Run(key string, ymd int) { log.Println("Run Mock Order.") var stocks []*models.StratModel @@ -87,7 +91,7 @@ func Report() { } // 3.判断盈亏超过10%,才确定平仓 - if pnlRate >= 10 { + if pnlRate >= DefaultClosedPnl { impl.DBService.Model(&models.MockPosition{}).Where("id=?", p.ID).Updates(map[string]any{ "close_price": newClosePrice, "pnl": pnl,