public void onQuoteRecap( MamdaSubscription sub, MamdaQuoteListener listener, MamaMsg msg, MamdaQuoteRecap recap) { Console.WriteLine ("Quote Recap (" + msg.getString (MamdaCommonFields.ISSUE_SYMBOL)+ "): "); }
/// <summary> /// Implementation of the MamdaMsgListener Interface. /// </summary> /// <param name="subscription"></param> /// <param name="msg"></param> /// <param name="msgType"></param> public void onMsg( MamdaSubscription subscription, MamaMsg msg, mamaMsgType msgType) { try { string symbol = msg.getString(MamdaCommonFields.ISSUE_SYMBOL); if(symbol == null) { return; } // First handle the message internally. i.e. create listener // lists, notify handlers etc. switch (msgType) { case mamaMsgType.MAMA_MSG_TYPE_INITIAL: case mamaMsgType.MAMA_MSG_TYPE_RECAP: handleFullImage(subscription, msg, msgType, symbol); break; case mamaMsgType.MAMA_MSG_TYPE_END_OF_INITIALS:/*Don't forward.*/ return; default: break; } // Now pass to other listeners (if any) forwardMsg(subscription, msg, msgType, symbol); } catch (MamdaDataException ex) { } }
void getEntryInfo( MamdaOrderBookEntry entry, MamaMsg entMsg, MamdaOrderBookPriceLevel level) { entry.setAction((MamdaOrderBookEntry.Actions)entMsg.getChar( MamdaOrderBookFields.ENTRY_ACTION, 'D')); entry.setId(entMsg.getString(MamdaOrderBookFields.ENTRY_ID)); entry.setSize((long)entMsg.getF64(MamdaOrderBookFields.ENTRY_SIZE, 0)); entry.setTime(entMsg.getDateTime(MamdaOrderBookFields.ENTRY_TIME, level.getTime())); }
public void onMsg (MamaSubscription subscription, MamaMsg msg) { switch (msg.getType()) { case mamaMsgType.MAMA_MSG_TYPE_INITIAL: char[] delimiter = {','}; string newSymbols = msg.getString (MamaReservedFields.SymbolList.getName(), (ushort)MamaReservedFields.SymbolList.getFid()); string[] parsedSymbols = newSymbols.Split(delimiter); for (int i=0; i<parsedSymbols.Length; i++) { subjectList.Add ((Object)parsedSymbols[i]); } Console.WriteLine("Received initial for symbol list subscription. Updating list of symbols to subscribe to.\n"); break; case mamaMsgType.MAMA_MSG_TYPE_END_OF_INITIALS: Console.WriteLine("End of initials. Subscribing to symbols.\n"); subscribeToSubjects(); break; default: break; } }
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() + ")"); }
public void onTradeReport( MamdaSubscription sub, MamdaTradeListener listener, MamaMsg msg, MamdaTradeReport trade, MamdaTradeRecap recap) { Console.WriteLine ("Trade (" + msg.getString (MamdaCommonFields.ISSUE_SYMBOL) + ":" + recap.getTradeCount() + "): " + trade.getTradeVolume() + " @ " + trade.getTradePrice() + " (seq#: " + trade.getEventSeqNum() + "; time: " + trade.getEventTime() + "; qual: " + trade.getTradeQual() + "; acttime: " + trade.getActivityTime() + ")"); }
public void onTradeGap( MamdaSubscription sub, MamdaTradeListener listener, MamaMsg msg, MamdaTradeGap gapEvent, MamdaTradeRecap recap) { Console.WriteLine("Trade gap (" + msg.getString (MamdaCommonFields.ISSUE_SYMBOL) + ":"+ gapEvent.getBeginGapSeqNum() + "-" + gapEvent.getEndGapSeqNum() + ")"); }