fix bug
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user