本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例4: Remove
/// <summary>
/// remove a publisher
/// </summary>
/// <param name="myPub"></param>
public void Remove(KaiTrade.Interfaces.Publisher myPub)
{
m_PublisherMap.Remove(myPub.TopicID());
}
示例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);
}
}