Example #1
0
 public void validate(ExecutionNew executionNew) {
   if (StringUtils.isBlank(executionNew.getExecutionId())) {
     throw new IllegalArgumentException("执行Id不能为空");
   } else if (StringUtils.isBlank(executionNew.getAccount())) {
     throw new IllegalArgumentException("交易账户不能为空");
   } else if (StringUtils.isBlank(executionNew.getPriceMode())) {
     throw new IllegalArgumentException("价格类型不能为空");
   } else if (StringUtils.isBlank(executionNew.getSymbol())) {
     throw new IllegalArgumentException("证券不能为空");
   } else if (StringUtils.isBlank(executionNew.getTradeType())) {
     throw new IllegalArgumentException("交易类型不能为空");
   }
 }
Example #2
0
 private ExecutionNew buildOrder(String tradeType, double price, long quantity) {
   ExecutionNew order = new ExecutionNew();
   order.setExecutionId(String.valueOf(ref.incrementAndGet()));
   order.setFundAccount(account);
   order.setSymbol(symbol);
   order.setTradeType(tradeType);
   order.setHedgeFlag(HedgeFlagConsts.SPECULATION);
   order.setPrice(price);
   order.setQuantity(quantity);
   order.setPriceMode(priceMode);
   return order;
 }