当前位置: 首页>>代码示例>>C#>>正文


C# Wombat.MamaMsg类代码示例

本文整理汇总了C#中Wombat.MamaMsg的典型用法代码示例。如果您正苦于以下问题:C# MamaMsg类的具体用法?C# MamaMsg怎么用?C# MamaMsg使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MamaMsg类属于Wombat命名空间,在下文中一共展示了MamaMsg类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: onQuoteRecap

 public void onQuoteRecap(
     MamdaSubscription   sub,
     MamdaQuoteListener  listener,
     MamaMsg             msg,
     MamdaQuoteRecap     recap)
 {
 }
开发者ID:jacobraj,项目名称:MAMA,代码行数:7,代码来源:UnderlyingTicker.cs

示例2: onQuoteClosing

 public void onQuoteClosing(
     MamdaSubscription   sub,
     MamdaQuoteListener  listener,
     MamaMsg             msg,
     MamdaQuoteClosing   closingEvent,
     MamdaQuoteRecap     recap)
 {
 }
开发者ID:jacobraj,项目名称:MAMA,代码行数:8,代码来源:UnderlyingTicker.cs

示例3: onQuoteRecap

        public void onQuoteRecap(
			MamdaSubscription   sub,
			MamdaQuoteListener  listener,
			MamaMsg             msg,
			MamdaQuoteRecap     recap)
        {
            Console.WriteLine ("Quote Recap (" + msg.getString
                            (MamdaCommonFields.ISSUE_SYMBOL)+ "): ");
        }
开发者ID:jacobraj,项目名称:MAMA,代码行数:9,代码来源:ComboTicker.cs

示例4: onQuoteClosing

        public void onQuoteClosing(
			MamdaSubscription   sub,
			MamdaQuoteListener  listener,
			MamaMsg             msg,
			MamdaQuoteClosing   closingEvent,
			MamdaQuoteRecap     recap)
        {
            Console.WriteLine("Quote Closing (" + sub.getSymbol() + "): ");
        }
开发者ID:jacobraj,项目名称:MAMA,代码行数:9,代码来源:ComboTicker.cs

示例5: onQuoteGap

        public void onQuoteGap(
			MamdaSubscription   sub,
			MamdaQuoteListener  listener,
			MamaMsg             msg,
			MamdaQuoteGap       gapEvent,
			MamdaQuoteRecap     recap)
        {
            Console.WriteLine("Quote gap (" + gapEvent.getBeginGapSeqNum() +
                            "-" + gapEvent.getEndGapSeqNum() + ")");
        }
开发者ID:jacobraj,项目名称:MAMA,代码行数:10,代码来源:ComboTicker.cs

示例6: addMamaHeaderFields

 public void addMamaHeaderFields(
                     MamaMsg msg,
                     byte msgType,
                     byte msgStatus,
                     uint seqNum)
 {
     msg.addU8(null, 1, msgType);
     msg.addU8(null, 2, msgStatus);
     msg.addU32(null, 10, seqNum);
     msg.addU64(null, 20, 1);
 }
开发者ID:jacobraj,项目名称:MAMA,代码行数:11,代码来源:MamdaQuoteListenerShortSaleTests.cs

示例7: Setup

        public void Setup()
        {
			Mama.loadBridge ("lbm");
			Mama.open ();
            // Create the message
            m_msg = new MamaMsg();

            // Create the array of messages
            m_vectorPrice = InitialisePriceArray(m_numberPrices, 69);
            m_vectorPrice2 = InitialisePriceArray(m_numberPrices, 144);
        }
开发者ID:jacobraj,项目名称:MAMA,代码行数:11,代码来源:MamaMsgVectorPriceTest.cs

示例8: testOrigShortSaleCircuitBreaker

 public void testOrigShortSaleCircuitBreaker()
 {
     mMsg = new MamaMsg();
     addMamaHeaderFields(mMsg,
                         (byte)mamaMsgType.MAMA_MSG_TYPE_CANCEL,
                         (byte)mamaMsgStatus.MAMA_MSG_STATUS_OK,
                         (uint)1);
     mMsg.addChar("wOrigShortSaleCircuitBreaker", 5249, 'C');
     ticker.callMamdaOnMsg(mSubscription, mMsg);
     Assert.AreEqual('C', ticker.myOrigShortSaleCircuitBreaker);
 }
开发者ID:jacobraj,项目名称:MAMA,代码行数:11,代码来源:MamdaTradeListenerShortSaleTests.cs

示例9: TestCorrTradeId

        public void TestCorrTradeId()
        {
            mMsg = new MamaMsg();

            addMamaHeaderFields(mMsg,
                                (byte)mamaMsgType.MAMA_MSG_TYPE_CORRECTION,
                                (byte)mamaMsgStatus.MAMA_MSG_STATUS_OK,
                                (uint)1);
            mMsg.addString("wCorrTradeId", 4060, "B");
            ticker.callMamdaOnMsg(mSubscription, mMsg);
            Assert.AreEqual("B", ticker.myCorrTradeId);
        }
开发者ID:jacobraj,项目名称:MAMA,代码行数:12,代码来源:MamdaTradeListenerTradeIdTests.cs

示例10: onQuoteUpdate

        public void onQuoteUpdate(
			MamdaSubscription   sub,
			MamdaQuoteListener  listener,
			MamaMsg             msg,
			MamdaQuoteUpdate    update,
			MamdaQuoteRecap     recap)
        {
            Console.WriteLine ("Quote ("  + msg.getString
                                (MamdaCommonFields.ISSUE_SYMBOL)   +
                                ":"        + recap.getQuoteCount()  +
                                "):  "     + update.getBidPrice()    +
                                " "        + update.getBidSize()     +
                                " X "      + update.getAskSize()     +
                                " "        + update.getAskPrice()    +
                                " (seq#: " + update.getEventSeqNum() +
                                "; time: " + update.getEventTime()   +
                                "; qual: " + update.getQuoteQual()   + ")");
        }
开发者ID:jacobraj,项目名称:MAMA,代码行数:18,代码来源:ComboTicker.cs

示例11: callMamdaOnMsg

 public void callMamdaOnMsg(MamdaSubscription sub, MamaMsg msg)
 {
     try
     {
         ArrayList msgListeners = new ArrayList();
         msgListeners = sub.getMsgListeners();
         IEnumerator iter = msgListeners.GetEnumerator();
         int size = msgListeners.Count;
         for (int i = 0; i < size; i++)
         {
             iter.MoveNext();
             MamdaMsgListener listener = (MamdaMsgListener)iter.Current;
             listener.onMsg(sub, msg, msg.getType());
         }
     }
     catch (Exception ex)
     {
         throw new MamdaDataException(ex.Message, ex);
     }
 }
开发者ID:jacobraj,项目名称:MAMA,代码行数:20,代码来源:MamdaTradeListenerAggressorSideTests.cs

示例12: CheckMessageArray

        private void CheckMessageArray(MamaMsg[] messages, int numberMessages, int offset)
        {
            // Verify that the array has the correct number of messages
            if (messages.Length != numberMessages)
            {
                throw new ArgumentOutOfRangeException("numberMessages");
            }

            // Chech each item in the array
            for (int nextMessage = 0; nextMessage < numberMessages; nextMessage++)
            {
                // Get the int32 field
                int intValue = messages[nextMessage].getI32(string.Empty, (ushort)(nextMessage + 1));

                // Verify that it has the correct value
                if (intValue != (nextMessage + offset))
                {
                    throw new InvalidOperationException();
                }
            }
        }
开发者ID:jacobraj,项目名称:MAMA,代码行数:21,代码来源:MamaMsgVectorMsgTest.cs

示例13: onMsg

		/// <summary>
		/// Implementation of MamdaListener interface.
		/// </summary>
		/// <param name="subscription"></param>
		/// <param name="msg"></param>
		/// <param name="msgType"></param>
		public void onMsg(
			MamdaSubscription	subscription,
			MamaMsg				msg,
			mamaMsgType			msgType)
		{
			if(!MamdaOptionFields.isSet())
			{
				return;
			}

			if (msgType == mamaMsgType.MAMA_MSG_TYPE_END_OF_INITIALS)
			{
				foreach (MamdaOptionChainHandler handler in mHandlers)
				{
					handler.onOptionChainRecap(subscription, this, msg, mChain);
				}
				return;
			}

			MamdaOptionContract contract = findContract(subscription, msg);

			switch (msgType)
			{
				case mamaMsgType.MAMA_MSG_TYPE_INITIAL:
				case mamaMsgType.MAMA_MSG_TYPE_RECAP:
					handleQuoteMsg(contract, subscription, msg, msgType);
					handleTradeMsg(contract, subscription, msg, msgType);
					break;
				case mamaMsgType.MAMA_MSG_TYPE_QUOTE:
					handleQuoteMsg(contract, subscription, msg, msgType);
					break;
				case mamaMsgType.MAMA_MSG_TYPE_TRADE:
				case mamaMsgType.MAMA_MSG_TYPE_CANCEL:
				case mamaMsgType.MAMA_MSG_TYPE_ERROR:
				case mamaMsgType.MAMA_MSG_TYPE_CORRECTION:
					handleTradeMsg(contract, subscription, msg, msgType);
					break;
			}
		}
开发者ID:jacobraj,项目名称:MAMA,代码行数:45,代码来源:MamdaOptionChainListener.cs

示例14: onTradeCorrection

            public void onTradeCorrection(
				MamdaSubscription        sub,
				MamdaTradeListener       listener,
				MamaMsg                  msg,
				MamdaTradeCorrection     correctionEvent,
				MamdaTradeRecap          recap)
            {
            }
开发者ID:jacobraj,项目名称:MAMA,代码行数:8,代码来源:MamdaOptionChainView.cs

示例15: extractPutCall

        private MamdaOptionContract.PutOrCall extractPutCall(
                MamaMsg        msg,
                string         fullSymbol)
            {
                MamdaOptionContract.PutOrCall putCall = MamdaOptionContract.PutOrCall.Unknown;
                int putCallInt = 0;               
                if (!msg.tryField (MamdaOptionFields.PUT_CALL, ref tmpfield_))
                {   
                    
                   Console.WriteLine("findContract:CANNOT find put/call in msg:"+fullSymbol+putCall);
                }
                else
                {
                    switch(tmpfield_.getType())
                    {
                        case mamaFieldType.MAMA_FIELD_TYPE_I8:
                        case mamaFieldType.MAMA_FIELD_TYPE_U8:
                        case mamaFieldType.MAMA_FIELD_TYPE_I16:
                        case mamaFieldType.MAMA_FIELD_TYPE_U16:                  
                            putCallInt = tmpfield_.getU16();
                        switch(putCallInt)
                        {
                            case 1:
                                putCall = MamdaOptionContract.PutOrCall.Put;
                                break;
                            case 2:
                                putCall = MamdaOptionContract.PutOrCall.Call;
                                break;
                            case 99:
                                putCall = MamdaOptionContract.PutOrCall.Unknown;
                                break;
                            default:
                                putCall =  MamdaOptionContract.PutOrCall.Unknown;                       
                                Console.WriteLine("Unhandled value for wPutCall."+ putCallInt);
                                break;
                        }
                        break; 
                        case mamaFieldType.MAMA_FIELD_TYPE_STRING:                       
                        string putCallStr = tmpfield_.getString();                      
                        switch (putCallStr[0])
                        {
                            case '1':
                            case 'P':
                                putCall = MamdaOptionContract.PutOrCall.Put;
                                break;
                            case '2':
                            case 'C':
                                putCall = MamdaOptionContract.PutOrCall.Call;
                                break;
                            default:
                                putCall = MamdaOptionContract.PutOrCall.Unknown; 
                                if ((putCallStr=="99") && (putCallStr=="Z"))
                                {
                                    Console.WriteLine("Unhandled value for wPutCall."+ putCallStr);

                                }
                                break;
                        }
                        break;
                        default:
                            putCall = MamdaOptionContract.PutOrCall.Unknown;               
                            Console.WriteLine("Unhandled type for wPutCall. Expected string or integer but returned: "+tmpfield_.getType());
                            break;
                    }
                }
                return putCall;
            }
开发者ID:jacobraj,项目名称:MAMA,代码行数:67,代码来源:MamdaOptionChainListener.cs


注:本文中的Wombat.MamaMsg类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。