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


C# Wombat.MamdaSubscription类代码示例

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


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

示例1: SetUp

        public void SetUp()
        {
            try
            {
                //Intialise mama
                myBridge = new MamaBridge("lbm");
                Mama.open();

                mDictionary = new MamaDictionary();
                mDictionary.create("dictionary.txt");

                MamdaCommonFields.setDictionary(mDictionary, null);
                MamdaTradeFields.reset();
                MamdaTradeFields.setDictionary(mDictionary, null);

                mSubscription = new MamdaSubscription();
                mTradeListener = new MamdaTradeListener();
                mSubscription.addMsgListener(mTradeListener);

                ticker = new tradetickerCB();
                mTradeListener.addHandler(ticker);

            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.ToString());
                Environment.Exit(1);
            }
        }
开发者ID:jacobraj,项目名称:MAMA,代码行数:29,代码来源:MamdaTradeListenerTradeIdTests.cs

示例2: onQuoteRecap

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

示例3: SetUp

        public void SetUp()
        {
            try
            {
                MamaBridge mBridge = Mama.loadBridge("lbm");
                Mama.open();

                MamaDictionary mDictionary = new MamaDictionary();
                mDictionary.create("dictionary.txt");

                MamdaCommonFields.setDictionary(mDictionary, null);
                MamdaQuoteFields.reset();
                MamdaQuoteFields.setDictionary(mDictionary, null);

                mSubscription = new MamdaSubscription();
                mQuoteListener = new MamdaQuoteListener();
                mSubscription.addMsgListener(mQuoteListener);

                ticker = new QuoteTicker();
                mQuoteListener.addHandler(ticker);

            }
            catch (Exception ex)
            {
                throw new MamdaDataException(ex.Message, ex);
            }
        }
开发者ID:jacobraj,项目名称:MAMA,代码行数:27,代码来源:MamdaQuoteListenerShortSaleTests.cs

示例4: onError

        public void onError(
			MamdaSubscription   subscription,
			MamdaErrorSeverity  severity,
			MamdaErrorCode      errorCode,
			string              errorStr)
        {
            Console.WriteLine("Error (" + subscription.getSymbol() + "): ");
        }
开发者ID:jacobraj,项目名称:MAMA,代码行数:8,代码来源:ComboTicker.cs

示例5: onQuoteClosing

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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: MamdaOrderBookChecker

        /// <summary>
        /// </summary>
        /// <param name="transport"></param>
        /// <param name="queue"></param>
        /// <param name="handler"></param>
        /// <param name="source"></param>
        /// <param name="symbol"></param>
        /// <param name="intervalSeconds"></param>
        public MamdaOrderBookChecker(
			MamaTransport transport,
			MamaQueue queue,
			MamdaOrderBookCheckerHandler handler,
			string source,
			string symbol,
			double intervalSeconds)
        {
            mSnapShotmHandler = new SnapShotChecker(this);
            mRealTimeSubsc = new MamdaSubscription();
            mRealTimeListener = new MamdaOrderBookListener();
            mHandler = handler;
            mQueue = queue;
            mIntervalSecs = intervalSeconds;
            mRandomTimerFired = false;
            mRealTimeSubsc.setType(mamaSubscriptionType.MAMA_SUBSC_TYPE_BOOK);
            mRealTimeSubsc.create(transport, queue, source, symbol, null);
            mRealTimeSubsc.addMsgListener(mRealTimeListener);
            init();
        }
开发者ID:jacobraj,项目名称:MAMA,代码行数:28,代码来源:MamdaOrderBookChecker.cs

示例12: SetUp

        public void SetUp()
        {
            try
            {
                MamaBridge mBridge = Mama.loadBridge("lbm");
                Mama.open();

                MamaDictionary mDictionary = new MamaDictionary();
                mDictionary.create("dictionary.txt");

                MamdaCommonFields.setDictionary(mDictionary, null);
                MamdaSecurityStatusFields.reset();
                MamdaSecurityStatusFields.setDictionary(mDictionary, null);

                mSubscription = new MamdaSubscription();
            }
            catch (Exception ex)
            {
                throw new MamdaDataException(ex.Message, ex);
            }
        }
开发者ID:jacobraj,项目名称:MAMA,代码行数:21,代码来源:MamdaSecStatusListenerShortSaleTests.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: SetUp

        public void SetUp()
        {
            try
            {
                MamaBridge mBridge = Mama.loadBridge("lbm");
                Mama.open();

                MamaDictionary mDictionary = new MamaDictionary();
                mDictionary.create("dictionary.txt");

                MamdaCommonFields.setDictionary(mDictionary, null);
                MamdaTradeFields.reset();
                MamdaTradeFields.setDictionary(mDictionary, null);

                mSubscription = new MamdaSubscription();
                mTradeListener = new MamdaTradeListener();
                mSubscription.addMsgListener(mTradeListener);
                recap = new MamdaConcreteTradeRecap();
            }
            catch (Exception ex)
            {
                throw new MamdaDataException(ex.Message, ex);
            }
        }
开发者ID:jacobraj,项目名称:MAMA,代码行数:24,代码来源:MamdaTradeListenerAggressorSideTests.cs

示例15: handleTradeMsg

		private void handleTradeMsg(
			MamdaOptionContract  contract,
			MamdaSubscription    subscription,
			MamaMsg              msg,
			mamaMsgType          msgType)
		{
			MamdaTradeListener tradeListener = contract.getTradeListener();
			if (tradeListener != null)
			{
				tradeListener.onMsg(subscription, msg, msgType);
			}
		}	
开发者ID:jacobraj,项目名称:MAMA,代码行数:12,代码来源:MamdaOptionChainListener.cs


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