| | |
| | | package com.xcong.excoin.modules.okxNewPrice.celue; |
| | | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.xcong.excoin.modules.okxNewPrice.okxWs.InstrumentsWs; |
| | | import com.xcong.excoin.modules.okxNewPrice.okxWs.PositionsWs; |
| | | import com.xcong.excoin.modules.okxNewPrice.okxWs.enums.CoinEnums; |
| | |
| | | log.info(OrderParamEnums.getNameByValue(state)); |
| | | |
| | | // 获取标记价格和平均持仓价格 |
| | | Object markPxObj = redisUtils.get(positionsMarkPxKey); |
| | | Object avgPxObj = redisUtils.get(positionsAvgPxKey); |
| | | String markPxObj = (String) redisUtils.get(positionsMarkPxKey); |
| | | String avgPxObj = (String) redisUtils.get(positionsAvgPxKey); |
| | | |
| | | if (markPxObj == null || avgPxObj == null) { |
| | | if (StrUtil.isBlank(markPxObj) || StrUtil.isBlank(avgPxObj)) { |
| | | return OrderParamEnums.INIT.getValue(); |
| | | } |
| | | |
| | | try { |
| | | BigDecimal markPx = new BigDecimal((String) markPxObj); |
| | | BigDecimal avgPx = new BigDecimal((String) avgPxObj); |
| | | BigDecimal markPx = new BigDecimal( markPxObj); |
| | | BigDecimal avgPx = new BigDecimal( avgPxObj); |
| | | |
| | | log.info("开仓价格: {}, 当前价格:{},匹配队列中......", avgPx, markPx); |
| | | |