| | |
| | | accFillSz, avgPx,state, fillFee,posSide |
| | | ); |
| | | |
| | | String clOrdIdStr = TradeOrderWs.getAccountMap(accountName).get("clOrdId"); |
| | | |
| | | Map<String, String> accountMap = getAccountMap(accountName); |
| | | String stateStr = TradeOrderWs.getAccountMap(accountName).get("state"); |
| | | boolean longSell = CoinEnums.POSSIDE_LONG.getCode().equals(posSide) && CoinEnums.SIDE_SELL.getCode().equals(side); |
| | | boolean shortBuy = CoinEnums.POSSIDE_SHORT.getCode().equals(posSide) && CoinEnums.SIDE_BUY.getCode().equals(side); |
| | | if ( |
| | | CoinEnums.ORDER_FILLED.getCode().equals(state) |
| | | && (longSell || shortBuy) |
| | | ){ |
| | | WsMapBuild.saveStringToMap(accountMap, "orderPrice",avgPx); |
| | | } |
| | | |
| | | String clOrdIdStr = TradeOrderWs.getAccountMap(accountName).get("clOrdId"); |
| | | if ( |
| | | StrUtil.isNotBlank(clOrdIdStr) |
| | | && clOrdId.equals(clOrdIdStr) |
| | | && StrUtil.isNotBlank(stateStr) |
| | | && state.equals(stateStr) |
| | | ){ |
| | | Map<String, String> accountMap = getAccountMap(accountName); |
| | | //记录成交均价 |
| | | if (accountMap.get("orderPrice") == null){ |
| | | log.info("成交均价: {}", avgPx); |