本文整理汇总了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);
}
}
示例2: onQuoteRecap
public void onQuoteRecap(
MamdaSubscription sub,
MamdaQuoteListener listener,
MamaMsg msg,
MamdaQuoteRecap recap)
{
}
示例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);
}
}
示例4: onError
public void onError(
MamdaSubscription subscription,
MamdaErrorSeverity severity,
MamdaErrorCode errorCode,
string errorStr)
{
Console.WriteLine("Error (" + subscription.getSymbol() + "): ");
}
示例5: onQuoteClosing
public void onQuoteClosing(
MamdaSubscription sub,
MamdaQuoteListener listener,
MamaMsg msg,
MamdaQuoteClosing closingEvent,
MamdaQuoteRecap recap)
{
}
示例6: onQuoteRecap
public void onQuoteRecap(
MamdaSubscription sub,
MamdaQuoteListener listener,
MamaMsg msg,
MamdaQuoteRecap recap)
{
Console.WriteLine ("Quote Recap (" + msg.getString
(MamdaCommonFields.ISSUE_SYMBOL)+ "): ");
}
示例7: onQuoteClosing
public void onQuoteClosing(
MamdaSubscription sub,
MamdaQuoteListener listener,
MamaMsg msg,
MamdaQuoteClosing closingEvent,
MamdaQuoteRecap recap)
{
Console.WriteLine("Quote Closing (" + sub.getSymbol() + "): ");
}
示例8: onQuoteGap
public void onQuoteGap(
MamdaSubscription sub,
MamdaQuoteListener listener,
MamaMsg msg,
MamdaQuoteGap gapEvent,
MamdaQuoteRecap recap)
{
Console.WriteLine("Quote gap (" + gapEvent.getBeginGapSeqNum() +
"-" + gapEvent.getEndGapSeqNum() + ")");
}
示例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() + ")");
}
示例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);
}
}
示例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();
}
示例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);
}
}
示例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;
}
}
示例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);
}
}
示例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);
}
}