| | |
| | | import com.xcong.excoin.processor.DefaultCoinProcessor; |
| | | import com.xcong.excoin.processor.MarketService; |
| | | import com.xcong.excoin.rabbit.pricequeue.WebsocketPriceService; |
| | | import com.xcong.excoin.rabbit.producer.ExchangeProducer; |
| | | import com.xcong.excoin.trade.CoinTrader; |
| | | import com.xcong.excoin.trade.CoinTraderFactory; |
| | | import com.xcong.excoin.utils.CoinTypeConvert; |
| | |
| | | @Resource |
| | | private CoinProcessorFactory processorFactory; |
| | | |
| | | @Resource |
| | | ExchangeProducer exchangeProducer; |
| | | |
| | | @PostConstruct |
| | | public void initCoinTrade() { |
| | | log.info("#=======撮合交易器开启=======#"); |
| | | String symbol = "NEKK"; |
| | | CoinTrader newTrader = new CoinTrader(symbol); |
| | | newTrader.setOrderCoinService(coinService); |
| | | newTrader.setExchangeProducer(exchangeProducer); |
| | | //newTrader.setKafkaTemplate(kafkaTemplate); |
| | | //newTrader.setBaseCoinScale(coin.getBaseCoinScale()); |
| | | //newTrader.setCoinScale(coin.getCoinScale()); |
| | |
| | | |
| | | // 创建成功以后需要对未处理订单预处理 |
| | | log.info("======CoinTrader Process: " + symbol + "======"); |
| | | List<OrderCoinsEntity> orders = orderCoinsDao.selectAllEntrustingCoinOrderList(); |
| | | List<String> symbolList = new ArrayList<>(); |
| | | symbolList.add(symbol); |
| | | List<OrderCoinsEntity> orders = orderCoinsDao.selectCoinOrderOnTrade(symbolList); |
| | | List<OrderCoinsEntity> tradingOrders = new ArrayList<>(); |
| | | List<OrderCoinsEntity> completedOrders = new ArrayList<>(); |
| | | orders.forEach(order -> { |