Administrator
2025-12-15 29c83b02a999073b09d2963adf139422aab96996
fix(okxNewPrice): 修正日志中收益比较值显示错误

- 修改 realizedPnlValue 大于零时的日志输出,使用正确的收益比较值
- 调整未实现盈亏判断条件中的金额计算逻辑
- 更新日志信息以准确反映交易决策依据
1 files modified
8 ■■■■ changed files
src/main/java/com/xcong/excoin/modules/okxNewPrice/celue/CaoZuoServiceImpl.java 8 ●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/celue/CaoZuoServiceImpl.java
@@ -180,20 +180,20 @@
                    if (realizedPnlValue.compareTo(BigDecimal.ZERO) <= 0) {
                        BigDecimal realizedPnlValueZheng = realizedPnlValue.multiply(new BigDecimal("-1"));
                        if (uplValue.compareTo(realizedPnlValue) > 0 && uplValue.compareTo(imrValue.add(realizedPnlValueZheng))  >= 0) {
                            log.info("当前未实现盈亏:{}大于预计收益>{},赚钱咯", uplValue, imrValue);
                            log.info("当前未实现盈亏:{}大于预计收益>{},赚钱咯", uplValue, imrValue.add(realizedPnlValueZheng));
                            WsMapBuild.saveStringToMap(OrderInfoWs.ORDERINFOWSMAP, "orderPrice", String.valueOf(markPx));
                            return OrderParamEnums.SELL.getValue();
                        }else{
                            log.info("当前未实现盈亏:{}没有大于预计收益>{},钱在路上了", uplValue, imrValue);
                            log.info("当前未实现盈亏:{}没有大于预计收益>{},钱在路上了", uplValue, imrValue.add(realizedPnlValueZheng));
                            return OrderParamEnums.HOLDING.getValue();
                        }
                    }else {
                        if (uplValue.compareTo(imrValue)  >= 0) {
                            WsMapBuild.saveStringToMap(OrderInfoWs.ORDERINFOWSMAP, "orderPrice", String.valueOf(markPx));
                            log.info("当前未实现盈亏:{}大于预计收益>{},赚钱咯", uplValue, imrValue);
                            log.info("当前未实现盈亏:{}大于预计收益>{},赚钱咯", uplValue, realizedPnlValue);
                            return OrderParamEnums.SELL.getValue();
                        }else{
                            log.info("当前未实现盈亏:{}没有大于预计收益>{},钱在路上了", uplValue, imrValue);
                            log.info("当前未实现盈亏:{}没有大于预计收益>{},钱在路上了", uplValue, realizedPnlValue);
                            return OrderParamEnums.HOLDING.getValue();
                        }
                    }