示例#1
0
    public void crack( QuickFix.Message message, QuickFix.SessionID sessionID, BeginString beginString )
    {
      String value = beginString.getValue();
      if (value.Equals("FIX.4.0"))
        ((QuickFix40.MessageCracker)this).crack(message, sessionID);
      else if (value.Equals("FIX.4.1"))
        ((QuickFix41.MessageCracker)this).crack(message, sessionID);
      else if (value.Equals("FIX.4.2"))
        ((QuickFix42.MessageCracker)this).crack(message, sessionID);
      else if (value.Equals("FIX.4.3"))
        ((QuickFix43.MessageCracker)this).crack(message, sessionID);
      else if (value.Equals("FIX.4.4"))
        ((QuickFix44.MessageCracker)this).crack(message, sessionID);
      else if (value.Equals("FIX.5.0"))
        ((QuickFix50.MessageCracker)this).crack(message, sessionID);
      else if (value.Equals("FIX.5.0SP1"))
        ((QuickFix50Sp1.MessageCracker)this).crack(message, sessionID);
      else if (value.Equals("FIX.5.0SP2"))
        ((QuickFix50Sp2.MessageCracker)this).crack(message, sessionID);
      else if( value.Equals("FIXT.1.1") )
      {
        if( message.isAdmin() )
        {
          ((QuickFixT11.MessageCracker)this).crack( message, sessionID );
        }
        else
        {
          ApplVerID applVerID = new ApplVerID();
          if( !message.getHeader().isSetField(applVerID) )
          {
            Session session = Session.lookupSession( sessionID );
            applVerID.setValue(session.getSenderDefaultApplVerID());
          }
          else
          {
            message.getHeader().getField( applVerID );
          }

          crack( message, sessionID, Message.toBeginString( applVerID ));
        }
      }
      else
        onMessage( message, sessionID );
    }
示例#2
0
        /// <summary>
        /// ���ԶԶ˵�Ӧ�ò㱨�ģ���Ҫҵ���߼�����
        /// </summary>
        /// <param name="pMessage"></param>
        /// <param name="pSessionID"></param>
        public void fromApp(QuickFix.Message pMessage, QuickFix.SessionID pSessionID)
        {
            string msgtype = pMessage.getHeader ().getString  (35);

            if (msgtype.StartsWith("Ans"))
            {
                //Console.WriteLine(pMessage.ToString());
                 switch (msgtype)
                {
                     case "Ans003":
                         //string ccy=pMessage .getField (
                     case "Ans002":
                         if (OnError != null)
                         {
                             OnError(pMessage.ToString(), EventArgs.Empty);
                         }
                        break;
                }
            }
            else
            {
                base.crack(pMessage, pSessionID);//����Ĭ�ϴ����������
            }
            pMessage.Dispose();//�����ֳ�����Ҫ
        }
示例#3
0
 public new void crack( QuickFix.Message message, QuickFix.SessionID sessionID )
 {
   BeginString beginString = new BeginString();
   message.getHeader().getField( beginString );
   crack( message, sessionID, beginString );
 }
示例#4
0
        public new void crack( QuickFix.Message message,
                     QuickFix.SessionID sessionID )
        {
            QuickFix.MsgType msgType = new QuickFix.MsgType();
            message.getHeader().getField(msgType);
            String msgTypeValue = msgType.getValue();

            if( msgTypeValue == "0" )
              onMessage( (Heartbeat)(message), sessionID );
            else
            if( msgTypeValue == "A" )
              onMessage( (Logon)(message), sessionID );
            else
            if( msgTypeValue == "1" )
              onMessage( (TestRequest)(message), sessionID );
            else
            if( msgTypeValue == "2" )
              onMessage( (ResendRequest)(message), sessionID );
            else
            if( msgTypeValue == "3" )
              onMessage( (Reject)(message), sessionID );
            else
            if( msgTypeValue == "4" )
              onMessage( (SequenceReset)(message), sessionID );
            else
            if( msgTypeValue == "5" )
              onMessage( (Logout)(message), sessionID );
            else
            if( msgTypeValue == "j" )
              onMessage( (BusinessMessageReject)(message), sessionID );
            else
            if( msgTypeValue == "BE" )
              onMessage( (UserRequest)(message), sessionID );
            else
            if( msgTypeValue == "BF" )
              onMessage( (UserResponse)(message), sessionID );
            else
            if( msgTypeValue == "7" )
              onMessage( (Advertisement)(message), sessionID );
            else
            if( msgTypeValue == "6" )
              onMessage( (IndicationOfInterest)(message), sessionID );
            else
            if( msgTypeValue == "B" )
              onMessage( (News)(message), sessionID );
            else
            if( msgTypeValue == "C" )
              onMessage( (Email)(message), sessionID );
            else
            if( msgTypeValue == "R" )
              onMessage( (QuoteRequest)(message), sessionID );
            else
            if( msgTypeValue == "AJ" )
              onMessage( (QuoteResponse)(message), sessionID );
            else
            if( msgTypeValue == "AG" )
              onMessage( (QuoteRequestReject)(message), sessionID );
            else
            if( msgTypeValue == "AH" )
              onMessage( (RFQRequest)(message), sessionID );
            else
            if( msgTypeValue == "S" )
              onMessage( (Quote)(message), sessionID );
            else
            if( msgTypeValue == "Z" )
              onMessage( (QuoteCancel)(message), sessionID );
            else
            if( msgTypeValue == "a" )
              onMessage( (QuoteStatusRequest)(message), sessionID );
            else
            if( msgTypeValue == "AI" )
              onMessage( (QuoteStatusReport)(message), sessionID );
            else
            if( msgTypeValue == "i" )
              onMessage( (MassQuote)(message), sessionID );
            else
            if( msgTypeValue == "b" )
              onMessage( (MassQuoteAcknowledgement)(message), sessionID );
            else
            if( msgTypeValue == "V" )
              onMessage( (MarketDataRequest)(message), sessionID );
            else
            if( msgTypeValue == "W" )
              onMessage( (MarketDataSnapshotFullRefresh)(message), sessionID );
            else
            if( msgTypeValue == "X" )
              onMessage( (MarketDataIncrementalRefresh)(message), sessionID );
            else
            if( msgTypeValue == "Y" )
              onMessage( (MarketDataRequestReject)(message), sessionID );
            else
            if( msgTypeValue == "c" )
              onMessage( (SecurityDefinitionRequest)(message), sessionID );
            else
            if( msgTypeValue == "d" )
              onMessage( (SecurityDefinition)(message), sessionID );
            else
            if( msgTypeValue == "v" )
              onMessage( (SecurityTypeRequest)(message), sessionID );
            else
            if( msgTypeValue == "w" )
              onMessage( (SecurityTypes)(message), sessionID );
            else
            if( msgTypeValue == "x" )
              onMessage( (SecurityListRequest)(message), sessionID );
            else
            if( msgTypeValue == "y" )
              onMessage( (SecurityList)(message), sessionID );
            else
            if( msgTypeValue == "z" )
              onMessage( (DerivativeSecurityListRequest)(message), sessionID );
            else
            if( msgTypeValue == "AA" )
              onMessage( (DerivativeSecurityList)(message), sessionID );
            else
            if( msgTypeValue == "e" )
              onMessage( (SecurityStatusRequest)(message), sessionID );
            else
            if( msgTypeValue == "f" )
              onMessage( (SecurityStatus)(message), sessionID );
            else
            if( msgTypeValue == "g" )
              onMessage( (TradingSessionStatusRequest)(message), sessionID );
            else
            if( msgTypeValue == "h" )
              onMessage( (TradingSessionStatus)(message), sessionID );
            else
            if( msgTypeValue == "D" )
              onMessage( (NewOrderSingle)(message), sessionID );
            else
            if( msgTypeValue == "8" )
              onMessage( (ExecutionReport)(message), sessionID );
            else
            if( msgTypeValue == "Q" )
              onMessage( (DontKnowTrade)(message), sessionID );
            else
            if( msgTypeValue == "G" )
              onMessage( (OrderCancelReplaceRequest)(message), sessionID );
            else
            if( msgTypeValue == "F" )
              onMessage( (OrderCancelRequest)(message), sessionID );
            else
            if( msgTypeValue == "9" )
              onMessage( (OrderCancelReject)(message), sessionID );
            else
            if( msgTypeValue == "H" )
              onMessage( (OrderStatusRequest)(message), sessionID );
            else
            if( msgTypeValue == "q" )
              onMessage( (OrderMassCancelRequest)(message), sessionID );
            else
            if( msgTypeValue == "r" )
              onMessage( (OrderMassCancelReport)(message), sessionID );
            else
            if( msgTypeValue == "AF" )
              onMessage( (OrderMassStatusRequest)(message), sessionID );
            else
            if( msgTypeValue == "s" )
              onMessage( (NewOrderCross)(message), sessionID );
            else
            if( msgTypeValue == "t" )
              onMessage( (CrossOrderCancelReplaceRequest)(message), sessionID );
            else
            if( msgTypeValue == "u" )
              onMessage( (CrossOrderCancelRequest)(message), sessionID );
            else
            if( msgTypeValue == "AB" )
              onMessage( (NewOrderMultileg)(message), sessionID );
            else
            if( msgTypeValue == "AC" )
              onMessage( (MultilegOrderCancelReplaceRequest)(message), sessionID );
            else
            if( msgTypeValue == "k" )
              onMessage( (BidRequest)(message), sessionID );
            else
            if( msgTypeValue == "l" )
              onMessage( (BidResponse)(message), sessionID );
            else
            if( msgTypeValue == "E" )
              onMessage( (NewOrderList)(message), sessionID );
            else
            if( msgTypeValue == "m" )
              onMessage( (ListStrikePrice)(message), sessionID );
            else
            if( msgTypeValue == "N" )
              onMessage( (ListStatus)(message), sessionID );
            else
            if( msgTypeValue == "L" )
              onMessage( (ListExecute)(message), sessionID );
            else
            if( msgTypeValue == "K" )
              onMessage( (ListCancelRequest)(message), sessionID );
            else
            if( msgTypeValue == "M" )
              onMessage( (ListStatusRequest)(message), sessionID );
            else
            if( msgTypeValue == "J" )
              onMessage( (AllocationInstruction)(message), sessionID );
            else
            if( msgTypeValue == "P" )
              onMessage( (AllocationInstructionAck)(message), sessionID );
            else
            if( msgTypeValue == "AS" )
              onMessage( (AllocationReport)(message), sessionID );
            else
            if( msgTypeValue == "AT" )
              onMessage( (AllocationReportAck)(message), sessionID );
            else
            if( msgTypeValue == "AK" )
              onMessage( (Confirmation)(message), sessionID );
            else
            if( msgTypeValue == "AU" )
              onMessage( (ConfirmationAck)(message), sessionID );
            else
            if( msgTypeValue == "BH" )
              onMessage( (ConfirmationRequest)(message), sessionID );
            else
            if( msgTypeValue == "T" )
              onMessage( (SettlementInstructions)(message), sessionID );
            else
            if( msgTypeValue == "AV" )
              onMessage( (SettlementInstructionRequest)(message), sessionID );
            else
            if( msgTypeValue == "AD" )
              onMessage( (TradeCaptureReportRequest)(message), sessionID );
            else
            if( msgTypeValue == "AQ" )
              onMessage( (TradeCaptureReportRequestAck)(message), sessionID );
            else
            if( msgTypeValue == "AE" )
              onMessage( (TradeCaptureReport)(message), sessionID );
            else
            if( msgTypeValue == "AR" )
              onMessage( (TradeCaptureReportAck)(message), sessionID );
            else
            if( msgTypeValue == "o" )
              onMessage( (RegistrationInstructions)(message), sessionID );
            else
            if( msgTypeValue == "p" )
              onMessage( (RegistrationInstructionsResponse)(message), sessionID );
            else
            if( msgTypeValue == "AL" )
              onMessage( (PositionMaintenanceRequest)(message), sessionID );
            else
            if( msgTypeValue == "AM" )
              onMessage( (PositionMaintenanceReport)(message), sessionID );
            else
            if( msgTypeValue == "AN" )
              onMessage( (RequestForPositions)(message), sessionID );
            else
            if( msgTypeValue == "AO" )
              onMessage( (RequestForPositionsAck)(message), sessionID );
            else
            if( msgTypeValue == "AP" )
              onMessage( (PositionReport)(message), sessionID );
            else
            if( msgTypeValue == "AW" )
              onMessage( (AssignmentReport)(message), sessionID );
            else
            if( msgTypeValue == "AX" )
              onMessage( (CollateralRequest)(message), sessionID );
            else
            if( msgTypeValue == "AY" )
              onMessage( (CollateralAssignment)(message), sessionID );
            else
            if( msgTypeValue == "AZ" )
              onMessage( (CollateralResponse)(message), sessionID );
            else
            if( msgTypeValue == "BA" )
              onMessage( (CollateralReport)(message), sessionID );
            else
            if( msgTypeValue == "BB" )
              onMessage( (CollateralInquiry)(message), sessionID );
            else
            if( msgTypeValue == "BC" )
              onMessage( (NetworkStatusRequest)(message), sessionID );
            else
            if( msgTypeValue == "BD" )
              onMessage( (NetworkStatusResponse)(message), sessionID );
            else
            if( msgTypeValue == "BG" )
              onMessage( (CollateralInquiryAck)(message), sessionID );
            else onMessage( message, sessionID );
        }
示例#5
0
        public new void crack( QuickFix.Message message,
                     QuickFix.SessionID sessionID )
        {
            QuickFix.MsgType msgType = new QuickFix.MsgType();
            message.getHeader().getField(msgType);
            String msgTypeValue = msgType.getValue();

            if( msgTypeValue == "0" )
              onMessage( (Heartbeat)(message), sessionID );
            else
            if( msgTypeValue == "A" )
              onMessage( (Logon)(message), sessionID );
            else
            if( msgTypeValue == "1" )
              onMessage( (TestRequest)(message), sessionID );
            else
            if( msgTypeValue == "2" )
              onMessage( (ResendRequest)(message), sessionID );
            else
            if( msgTypeValue == "3" )
              onMessage( (Reject)(message), sessionID );
            else
            if( msgTypeValue == "4" )
              onMessage( (SequenceReset)(message), sessionID );
            else
            if( msgTypeValue == "5" )
              onMessage( (Logout)(message), sessionID );
            else
            if( msgTypeValue == "7" )
              onMessage( (Advertisement)(message), sessionID );
            else
            if( msgTypeValue == "6" )
              onMessage( (IndicationofInterest)(message), sessionID );
            else
            if( msgTypeValue == "B" )
              onMessage( (News)(message), sessionID );
            else
            if( msgTypeValue == "C" )
              onMessage( (Email)(message), sessionID );
            else
            if( msgTypeValue == "R" )
              onMessage( (QuoteRequest)(message), sessionID );
            else
            if( msgTypeValue == "S" )
              onMessage( (Quote)(message), sessionID );
            else
            if( msgTypeValue == "i" )
              onMessage( (MassQuote)(message), sessionID );
            else
            if( msgTypeValue == "Z" )
              onMessage( (QuoteCancel)(message), sessionID );
            else
            if( msgTypeValue == "a" )
              onMessage( (QuoteStatusRequest)(message), sessionID );
            else
            if( msgTypeValue == "b" )
              onMessage( (QuoteAcknowledgement)(message), sessionID );
            else
            if( msgTypeValue == "V" )
              onMessage( (MarketDataRequest)(message), sessionID );
            else
            if( msgTypeValue == "W" )
              onMessage( (MarketDataSnapshotFullRefresh)(message), sessionID );
            else
            if( msgTypeValue == "X" )
              onMessage( (MarketDataIncrementalRefresh)(message), sessionID );
            else
            if( msgTypeValue == "Y" )
              onMessage( (MarketDataRequestReject)(message), sessionID );
            else
            if( msgTypeValue == "c" )
              onMessage( (SecurityDefinitionRequest)(message), sessionID );
            else
            if( msgTypeValue == "d" )
              onMessage( (SecurityDefinition)(message), sessionID );
            else
            if( msgTypeValue == "e" )
              onMessage( (SecurityStatusRequest)(message), sessionID );
            else
            if( msgTypeValue == "f" )
              onMessage( (SecurityStatus)(message), sessionID );
            else
            if( msgTypeValue == "g" )
              onMessage( (TradingSessionStatusRequest)(message), sessionID );
            else
            if( msgTypeValue == "h" )
              onMessage( (TradingSessionStatus)(message), sessionID );
            else
            if( msgTypeValue == "D" )
              onMessage( (NewOrderSingle)(message), sessionID );
            else
            if( msgTypeValue == "8" )
              onMessage( (ExecutionReport)(message), sessionID );
            else
            if( msgTypeValue == "Q" )
              onMessage( (DontKnowTrade)(message), sessionID );
            else
            if( msgTypeValue == "G" )
              onMessage( (OrderCancelReplaceRequest)(message), sessionID );
            else
            if( msgTypeValue == "F" )
              onMessage( (OrderCancelRequest)(message), sessionID );
            else
            if( msgTypeValue == "9" )
              onMessage( (OrderCancelReject)(message), sessionID );
            else
            if( msgTypeValue == "H" )
              onMessage( (OrderStatusRequest)(message), sessionID );
            else
            if( msgTypeValue == "J" )
              onMessage( (Allocation)(message), sessionID );
            else
            if( msgTypeValue == "P" )
              onMessage( (AllocationACK)(message), sessionID );
            else
            if( msgTypeValue == "T" )
              onMessage( (SettlementInstructions)(message), sessionID );
            else
            if( msgTypeValue == "k" )
              onMessage( (BidRequest)(message), sessionID );
            else
            if( msgTypeValue == "l" )
              onMessage( (BidResponse)(message), sessionID );
            else
            if( msgTypeValue == "E" )
              onMessage( (NewOrderList)(message), sessionID );
            else
            if( msgTypeValue == "m" )
              onMessage( (ListStrikePrice)(message), sessionID );
            else
            if( msgTypeValue == "N" )
              onMessage( (ListStatus)(message), sessionID );
            else
            if( msgTypeValue == "L" )
              onMessage( (ListExecute)(message), sessionID );
            else
            if( msgTypeValue == "K" )
              onMessage( (ListCancelRequest)(message), sessionID );
            else
            if( msgTypeValue == "M" )
              onMessage( (ListStatusRequest)(message), sessionID );
            else
            if( msgTypeValue == "j" )
              onMessage( (BusinessMessageReject)(message), sessionID );
            else onMessage( message, sessionID );
        }