| | |
| | | tradeRequestParam.setClOrdId(clOrdId); |
| | | String sz = InstrumentsWs.getAccountMap(accountName).get(CoinEnums.BUY_CNT_INIT.name()); |
| | | tradeRequestParam.setSz(sz); |
| | | |
| | | WsMapBuild.saveStringToMap(OrderInfoWs.getAccountMap(accountName), "orderPrice", String.valueOf(markPx)); |
| | | return tradeRequestParam; |
| | | } |
| | | |
| | |
| | | if (pingCang != null && avgPx.compareTo(pingCang.getValue()) < 0) { |
| | | log.info("开始卖出平多...卖出平多队列价格大于开仓价格{}>{}", pingCang.getValue(), avgPx); |
| | | // 手续费 |
| | | BigDecimal feeValue = PositionsWs.getAccountMap(positionAccountName).get("fee"); |
| | | BigDecimal feeValue = PositionsWs.getAccountMap(positionAccountName).get("fee").multiply(new BigDecimal(2)); |
| | | //未实现收益 |
| | | BigDecimal uplValue = PositionsWs.getAccountMap(positionAccountName).get("upl"); |
| | | //已实现收益 |
| | |
| | | if (pingCang != null && markPx.compareTo(pingCang.getValue()) >= 0 && avgPx.compareTo(pingCang.getValue()) < 0) { |
| | | log.info("开始加仓...上限队列价格小于当前价格{}<={}", pingCang.getValue(), markPx); |
| | | WsMapBuild.saveStringToMap(OrderInfoWs.getAccountMap(accountName), "orderPrice", String.valueOf(markPx)); |
| | | String side = CoinEnums.SIDE_BUY.getCode(); |
| | | String side = CoinEnums.SIDE_SELL.getCode(); |
| | | tradeRequestParam.setSide(side); |
| | | String clOrdId = WsParamBuild.getOrderNum(side); |
| | | tradeRequestParam.setClOrdId(clOrdId); |