Esempio n. 1
0
 public void CancelOrder(CancelOrderRequest cancelOrderRequest, OnInstructionResponse instructionCallback, OnFailure failureCallback)
 {
     OrderResponseHandler handler = new OrderResponseHandler();
     SendRequest(cancelOrderRequest, handler, delegate() { instructionCallback(handler.InstructionId); }, failureCallback);
 }
        private void CancelOrder(OrderTracker orderTracker)
        {
            long originalInstructionId = orderTracker.InstructionId;

            if (originalInstructionId != -1)
            {
                orderTracker.CancelInstructionId = NextInstructionId();
                CancelOrderRequest cancelOrderRequest = new CancelOrderRequest(orderTracker.CancelInstructionId,
                                                                               _instrumentId,
                                                                               originalInstructionId);
                _session.CancelOrder(cancelOrderRequest,
                                     instructionId =>
                                     Console.WriteLine("instruction id " + orderTracker.CancelInstructionId +
                                                       " sent to cancel order " + originalInstructionId),
                                     FailureCallback("Cancel order with cancelOrderInstructionId: " +
                                                     orderTracker.CancelInstructionId));
            }
        }