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


C# KaiTrade.TopicID方法代码示例

本文整理汇总了C#中KaiTrade.TopicID方法的典型用法代码示例。如果您正苦于以下问题:C# KaiTrade.TopicID方法的具体用法?C# KaiTrade.TopicID怎么用?C# KaiTrade.TopicID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KaiTrade的用法示例。


在下文中一共展示了KaiTrade.TopicID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Add

 /// <summary>
 /// Add/replace a publisher to the manager
 /// </summary>
 /// <param name="myPub"></param>
 public void Add(KaiTrade.Interfaces.Publisher myPub)
 {
     if(m_PublisherMap.ContainsKey(myPub.TopicID()))
     {
         m_PublisherMap[myPub.TopicID()] = myPub;
     }
     else
     {
         m_PublisherMap.Add(myPub.TopicID(), myPub);
     }
 }
开发者ID:junwin,项目名称:TradingTools,代码行数:15,代码来源:PublisherMgr.cs

示例2: doSubscribeMD

        public void doSubscribeMD(KaiTrade.Interfaces.Publisher myPub, int depthLevels, string requestID)
        {
            try
            {

                // Subscribe to the market data from TWS

                // get the product
                KaiTrade.Interfaces.TradableProduct product = m_Facade.Factory.GetProductManager().GetProductMnemonic(myPub.TopicID());

                // IB's newest API uses its IContract
                // Note the PXPublisher must have a valid product
                if (product == null)
                {
                    throw new Exception("The PXPublisher does not have a product");
                }
                // register the pub against the IB ReqID - updates pass that back

                m_IBReqIDProductMap.Add(++m_NextID, product);

                TWSLib.IContract myContract = getIBContract(product);

                myContract.multiplier = "0";
               // m_Host.TWS.reqMktDataEx(m_NextID, myContract, m_QuoteFields, 0);

                if (depthLevels > 0)
                {
                    m_Host.TWS.reqMktDepthEx(m_NextID, myContract, depthLevels);
                    m_Host.TWS.reqMktDataEx(m_NextID, myContract, m_QuoteFields, 0);
                }
                else
                {
                    m_Host.TWS.reqMktDataEx(m_NextID, myContract, m_QuoteFields, 0);
                }

            }
            catch (Exception myE)
            {
                _log.Error("doSubscribeMD", myE);
            }
        }
开发者ID:junwin,项目名称:TradingTools,代码行数:41,代码来源:KTAIB.cs

示例3: DoUnRegister

        /// <summary>
        /// Override the base driver's un register publisher method
        /// </summary>
        /// <param name="myPublisher"></param>
        protected override void DoUnRegister(KaiTrade.Interfaces.IPublisher myPublisher)
        {
            try
            {
                if (_publisherRegister.ContainsKey(myPublisher.TopicID()))
                {
                    _publisherRegister.Remove(myPublisher.TopicID());
                }

                //UnSubscribeMD(myPublisher);
            }
            catch (Exception myE)
            {
                log.Error("Driver.UnRegister:publisher", myE);
            }
        }
开发者ID:junwin,项目名称:TradingTools,代码行数:20,代码来源:KTASimulator.cs

示例4: Remove

 /// <summary>
 /// remove a publisher
 /// </summary>
 /// <param name="myPub"></param>
 public void Remove(KaiTrade.Interfaces.Publisher myPub)
 {
     m_PublisherMap.Remove(myPub.TopicID());
 }
开发者ID:junwin,项目名称:TradingTools,代码行数:8,代码来源:PublisherMgr.cs

示例5: UnSubscribeMD

        protected override void UnSubscribeMD(KaiTrade.Interfaces.IPublisher pub)
        {
            try
            {
                // check if the subject is already registered and add or update
                // the map of subjects we are keeping - this can be used to
                // resubscribe

                string myKey = pub.TopicID();

                // Try and get the product def fromn the interest list
                //if (m_ProductDefs.ContainsKey(myKey))
                //{
                //   KaiTrade.Interfaces.IProduct myDef = m_ProductDefs[myKey] as KaiTrade.Interfaces.IProduct;
                //   unSubscribeProduct(myDef);
                //}
            }
            catch (Exception myE)
            {
                log.Error("UnSubscribeMD", myE);
            }
        }
开发者ID:junwin,项目名称:TradingTools,代码行数:22,代码来源:KTACQG.cs


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