| | |
| | | realKuiSunAmount = realKuiSunAmount.multiply(new BigDecimal("-1")); |
| | | // 账户预期亏损金额比这个还小时,立即止损 |
| | | if (realKuiSunAmount.compareTo(zhiSunAmount) > 0){ |
| | | log.warn("账户冷静止损......"); |
| | | log.error("账户冷静止损......"); |
| | | //目前止损掉损失较大的一个方向 |
| | | String positionAccountName = PositionsWs.initAccountName(accountName, posSide); |
| | | BigDecimal upl = PositionsWs.getAccountMap(positionAccountName).get("upl"); |
| | |
| | | String positionAccountOther = PositionsWs.initAccountName(accountName, posSideOther); |
| | | BigDecimal uplOther = PositionsWs.getAccountMap(positionAccountOther).get("upl"); |
| | | if (upl.compareTo(uplOther) > 0){ |
| | | log.warn("{}的亏损{},{}的亏损{},止损{}......",posSide,upl,posSideOther,uplOther,uplOther); |
| | | log.error("{}的亏损{},{}的亏损{},止损{}......",posSide,upl,posSideOther,uplOther,uplOther); |
| | | posSide = posSideOther; |
| | | } |
| | | |