任何人都可以告诉我,在哪些情况下quickfix.Session.sentToTarget(message,sessionId)返回false。实际上我们试图将命令发送给aceptor,它返回false,不抛出任何异常。不知道为什么会发生这种情况似乎很好。
public void sendOrder(SessionID sessionId){
ClOrdID order_id = new ClOrdID();
order_id.setValue("121ifkaar");
OrdType type = new OrdType(OrdType.LIMIT);
OrderQty quantity = new OrderQty();
quantity.setValue(new Double(79955));
NewOrderSingle newOrderSingle = new NewOrderSingle(order_id, new Side(Side.SELL), new TransactTime(), type );
newOrderSingle.set(new Account("ifkaar123"));
newOrderSingle.set(new Symbol("USD"));
newOrderSingle.set(new Currency("United State Doller"));
Message msg = (Message)newOrderSingle;
try{
boolean result = Session.sendToTarget(msg, sessionId);
if(result){
System.out.println("Message Send: "+result);
}else{
System.out.println("Message Not send: "+result);
}
}catch(Exception e){e.printStackTrace();}
}
答案 0 :(得分:0)
首先,当你启动你的发起人时,你会看到HeartBeat消息(标签35 = 0)流入和流向交易对手?