| | |
| | | String positionAccountName = PositionsWs.initAccountName(accountName, posSide); |
| | | BigDecimal pos = PositionsWs.getAccountMap(positionAccountName).get("pos"); |
| | | if (BigDecimal.ZERO.compareTo( pos) >= 0) { |
| | | log.error("历史网格止损方向没有持仓"); |
| | | tradeRequestParam.setTradeType(OrderParamEnums.TRADE_NO.getValue()); |
| | | } |
| | | tradeRequestParam.setSz(String.valueOf( pos)); |
| | |
| | | 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"); |
| | | //已实现收益 |
| | |
| | | log.info("开始买入平空...买入平空队列价格小于开仓价格{}<{}", kaiCang.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"); |
| | | //已实现收益 |