| | |
| | | if (StrUtil.isNotEmpty(wanggeName) && !wanggeName.equals(gridByPrice.name())){ |
| | | log.error("正在止损老的网格仓位......"); |
| | | WangGeListEnum oldWangge = WangGeListEnum.getByName(wanggeName); |
| | | WsMapBuild.saveStringToMap(accountMap, CoinEnums.POSSIDE.name(), oldWangge.getFang_xiang()); |
| | | return OrderParamEnums.OUT.getValue(); |
| | | if (oldWangge != null){ |
| | | WsMapBuild.saveStringToMap(accountMap, CoinEnums.POSSIDE.name(), oldWangge.getFang_xiang()); |
| | | return OrderParamEnums.OUT.getValue(); |
| | | } |
| | | } |
| | | String posSide = gridByPrice.getFang_xiang(); |
| | | log.info("仓位方向: {}", posSide); |
| | |
| | | BigDecimal pos = PositionsWs.getAccountMap(positionAccountName).get("pos"); |
| | | if (BigDecimal.ZERO.compareTo( pos) >= 0) { |
| | | log.error("持仓数量为零,进行初始化订单"); |
| | | return OrderParamEnums.INIT.getValue(); |
| | | return null; |
| | | } |
| | | // 判断是否保证金超标 |
| | | if (PositionsWs.getAccountMap(positionAccountName).get("imr") == null){ |