| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.xcong.excoin.modules.blackchain.service.DateUtil; |
| | | import com.xcong.excoin.modules.okxNewPrice.celue.CaoZuoService; |
| | | import com.xcong.excoin.modules.okxNewPrice.indicator.TradingStrategy; |
| | | import com.xcong.excoin.modules.okxNewPrice.indicator.macdAndMatrategy.MacdMaStrategy; |
| | |
| | | BigDecimal lowPx = new BigDecimal(data.getString(3)); |
| | | BigDecimal closePx = new BigDecimal(data.getString(4)); |
| | | BigDecimal vol = new BigDecimal(data.getString(5)); |
| | | //ts String 开始时间,Unix时间戳的毫秒数格式,如 1597026383085 转日期:2020-08-07 15:13:03.085 |
| | | String time = DateUtil.TimeStampToDateTime(Long.parseLong(data.getString(0))); |
| | | /** |
| | | * K线状态 |
| | | * 0:K线未完结 |
| | |
| | | */ |
| | | String confirm = data.getString(8); |
| | | if ("1".equals(confirm)){ |
| | | log.info("{}K线已完结{}:{}",time,closePx,instId); |
| | | //调用策略 |
| | | // 创建策略实例 |
| | | MacdMaStrategy strategy = new MacdMaStrategy(); |