This commit is contained in:
yanweidong
2026-02-10 19:04:09 +08:00
parent f4ade78f8c
commit f35e7d5e9a
4 changed files with 60 additions and 1 deletions

View File

@@ -67,7 +67,7 @@ func CheckClose() {
// 2.计算盈亏
pnl := utils.FloatRound(newClosePrice-p.OpenPrice, 2)
pnlRate := utils.FloatRound(p.Pnl/p.OpenPrice*100, 2)
pnlRate := utils.FloatRound(pnl/p.OpenPrice*100, 2)
log.Printf("Pnl for %s is %f,rate %f", p.Code, pnl, pnlRate)
// 3.判断盈亏超过20%,才确定平仓
if pnlRate >= 20 {