public void onQuoteRecap( MamdaSubscription sub, MamdaQuoteListener listener, MamaMsg msg, MamdaQuoteRecap recap) { }
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); } }
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); } }
public void onQuoteClosing( MamdaSubscription sub, MamdaQuoteListener listener, MamaMsg msg, MamdaQuoteClosing closingEvent, MamdaQuoteRecap recap) { }
public void onError( MamdaSubscription subscription, MamdaErrorSeverity severity, MamdaErrorCode errorCode, string errorStr) { Console.WriteLine("Error (" + subscription.getSymbol() + "): "); }
public void onQuoteRecap( MamdaSubscription sub, MamdaQuoteListener listener, MamaMsg msg, MamdaQuoteRecap recap) { Console.WriteLine ("Quote Recap (" + msg.getString (MamdaCommonFields.ISSUE_SYMBOL)+ "): "); }
public void onQuoteClosing( MamdaSubscription sub, MamdaQuoteListener listener, MamaMsg msg, MamdaQuoteClosing closingEvent, MamdaQuoteRecap recap) { Console.WriteLine("Quote Closing (" + sub.getSymbol() + "): "); }
public void onQuoteGap( MamdaSubscription sub, MamdaQuoteListener listener, MamaMsg msg, MamdaQuoteGap gapEvent, MamdaQuoteRecap recap) { Console.WriteLine("Quote gap (" + gapEvent.getBeginGapSeqNum() + "-" + gapEvent.getEndGapSeqNum() + ")"); }
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 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); } }
/// <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(); }
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); } }
private void handleUpdate( MamdaSubscription subscription, MamaMsg msg) { if (!mGotInitial) { throw new MamdaOrderBookException( "got update before initial/recap"); } // Synchronize the current Order Book in case a snapshot is being created if (mFullBook != null) { lock (mFullBook) { handleUpdateImpl(subscription, msg); } } else { handleUpdateImpl(subscription, msg); } }
/// <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; } }
/* End Field State Accessors */ // Implementation of MamdaListener interface. // NB! For internal use only. public void onMsg( MamdaSubscription subscription, MamaMsg msg, mamaMsgType msgType) { // Listeners may be created on multiple threads and we only // want a single list of updaters. if (mUpdaters == null) { lock (mUpdatersGuard) { if (!MamdaAuctionFields.isSet()) { return; } if (mUpdaters == null) { AuctionUpdate[] updaters = createUpdaters(); Thread.MemoryBarrier(); mUpdaters = updaters; } } } // If msg is a Auction-related message, invoke the // appropriate callback: switch (msgType) { case mamaMsgType.MAMA_MSG_TYPE_INITIAL: case mamaMsgType.MAMA_MSG_TYPE_RECAP: case mamaMsgType.MAMA_MSG_TYPE_UPDATE: handleAuctionMessage(subscription, msg, msgType); break; default: break; } }
private void forwardMsg( MamdaSubscription subscription, MamaMsg msg, mamaMsgType msgType, String symbol) { ArrayList securityListeners = (ArrayList)mListeners.valueOf(symbol); if ((securityListeners != null) && (securityListeners.Count > 0)) { forwardMsg( securityListeners, subscription, msg, msgType); } else { /*Needed for new symbols created intraday*/ checkSecurityCreateNotify(subscription, symbol); } }
private void forwardMsg( MamdaSubscription subscription, MamaMsg msg, mamaMsgType msgType, String partId) { if (partId == null) /*Participant message*/ { /* We may not have an entry for this partId at this stage as * we may not be receiving initial values for the subscription. */ ParticipantInfo partInfo = getParticipantInfo(partId); /* Need to check if we have notified. We may well not be receiving * initials*/ checkParticipantCreateNotify(subscription, partId, partInfo); /* We may have a ParticipantInfo entry for the partId but there is * still no guarantee that any listeners have been registered. * This is quite acceptable as users may not be interested in all * participants. */ if (partInfo.mParticipantListeners.Count > 0) { forwardMsg(partInfo.mParticipantListeners, subscription, msg, msgType); } } else /*Consolidated message*/ { /* We may not have notified the user that a consolidated message * has arrived. If not using initials this can be the case.*/ checkConsolidatedCreateNotify(subscription); /* Forward the message if we have any listeners*/ if (mConsolidatedListeners.Count > 0) { forwardMsg(mConsolidatedListeners, subscription, msg, msgType); } } }
/// <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 (!MamdaFundamentalFields.isSet()) { return; } // If msg is a trade-related message, invoke the // appropriate callback: switch (msgType) { case mamaMsgType.MAMA_MSG_TYPE_INITIAL: case mamaMsgType.MAMA_MSG_TYPE_RECAP: handleRecap(subscription, msg); break; case mamaMsgType.MAMA_MSG_TYPE_UPDATE: handleUpdate(subscription, msg); break; } }
private void handleRecap( MamdaSubscription subscription, MamaMsg msg) { // Synchronize the current Order Book in case a snapshot is being created if (mFullBook != null) { lock (mFullBook) { msg.tryU64(MamaReservedFields.SenderId, ref mPreviousSenderId); handleStandardFields(subscription, msg, false); if (createDeltaFromMamaMsg(mTempmDeltaBook, msg)) { mDeltaBook.setSymbol(subscription.getSymbol()); mDeltaBook.setBookTime(msg.getDateTime(MamdaOrderBookFields.BOOK_TIME, mSrcTime)); mDeltaBook.setAsDeltaDifference(mFullBook, mTempmDeltaBook); mFullBook.copy(mTempmDeltaBook); mFullBook.setSymbol(subscription.getSymbol()); mFullBook.setBookTime(mDeltaBook.getBookTime()); mFullBook.setIsConsistent(true); invokeRecapHandlers(subscription, msg); } } } else { handleStandardFields(subscription, msg, false); // Set the delta to be the contents of the recap. if (createDeltaFromMamaMsg(mDeltaBook, msg)) { mDeltaBook.setSymbol(subscription.getSymbol()); invokeRecapHandlers(subscription, msg); } } mGotInitial = true; }
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); } }
public void onTradeGap( MamdaSubscription sub, MamdaTradeListener listener, MamaMsg msg, MamdaTradeGap gapEvent, MamdaTradeRecap recap) { }
public void onTradeCorrection( MamdaSubscription sub, MamdaTradeListener listener, MamaMsg msg, MamdaTradeCorrection correctionEvent, MamdaTradeRecap recap) { }
private void getLevelInfoAndEntries( MamdaSubscription subscription, MamaMsg msg, MamaMsg plMsg, bool isRecap) { double priceLevelSizeChange = 0.0; int priceLevelActionInt = 0; int priceLevelSideInt = 0; MamaMsg entMsg = null; plMsg.tryPrice(MamdaOrderBookFields.PL_PRICE, ref mPriceLevelPrice); plMsg.tryF64(MamdaOrderBookFields.PL_SIZE, ref mPriceLevelSize); plMsg.tryF64(MamdaOrderBookFields.PL_NUM_ENTRIES, ref mPriceLevelNumEntries); if (plMsg.tryI32(MamdaOrderBookFields.PL_ACTION, ref priceLevelActionInt)) { mPriceLevelAction = (sbyte)priceLevelActionInt; } if (plMsg.tryI32(MamdaOrderBookFields.PL_SIDE, ref priceLevelSideInt)) { mPriceLevelSide = (sbyte)priceLevelSideInt; } // Optional order book fields: mPriceLevelTime = plMsg.getDateTime(MamdaOrderBookFields.PL_TIME, mEventTime); if (plMsg.tryF64(MamdaOrderBookFields.PL_SIZE_CHANGE, ref priceLevelSizeChange)) { mPriceLevelSizeChange = (long)priceLevelSizeChange; } // Call the Price Level Handler if set if (mLevelHandler != null) { if (isRecap) { mLevelHandler.onBookAtomicLevelRecap( subscription, this, msg, this); } else { mLevelHandler.onBookAtomicLevelDelta( subscription, this, msg, this); } } // Handle entries. // // Note: the number of entries actually present may well // not add up to the PL_NUM_ENTRIES; it may be more than, // less than or equal to PL_NUM_ENTRIES. For example, if // the delta is a price level update then PL_NUM_ENTRIES // indicates the total number of remaining entries whereas // the array of entries in the message will only contain // those that are being added/deleted/updated. Only if the // price level action is an add should the number of // entries match. // if (mLevelEntryHandler != null) { // clear entry cache clearLevelEntryFields(); // First try a single vector. int numEntriesInMsg = 0; MamaMsg[] msgEntries = null; /* We won't have PL_ENTRIES if FieldAttrsOrderBookWombatMsg * is not specified in the data dictionary */ if (MamdaOrderBookFields.PL_ENTRIES != null) { /* null is passed as default value otherwise * getVectorMsg throws an exception if not found */ msgEntries = plMsg.getVectorMsg(MamdaOrderBookFields.PL_ENTRIES, null); if (msgEntries != null) { numEntriesInMsg = msgEntries.Length; } } if (numEntriesInMsg > 0) { mPriceLevelActNumEntries = numEntriesInMsg; for (int j = 0; j < numEntriesInMsg; j++) { entMsg = msgEntries[j]; getEntriesInfo(entMsg); if (isRecap) { mLevelEntryHandler.onBookAtomicLevelEntryRecap( subscription, this, msg, this); } else { mLevelEntryHandler.onBookAtomicLevelEntryDelta( subscription, this, msg, this); } } } else { // Second, try the list of entries. int maxEntryFields = MamdaOrderBookFields.getNumEntryFields(); // getNumEntryFields() defaults to 0 but we want to go into the // below loop at least once for flattened messages scenario if (maxEntryFields == 0) { maxEntryFields = 1; } int numEntryAttached = plMsg.getI32(MamdaOrderBookFields.PL_NUM_ATTACH, 1); if (numEntryAttached < maxEntryFields) { maxEntryFields = numEntryAttached; } mPriceLevelActNumEntries = maxEntryFields; for (int j = 1; j <= maxEntryFields; j++) { if (MamdaOrderBookFields.PL_ENTRY.Length > 1) { entMsg = plMsg.getMsg(MamdaOrderBookFields.PL_ENTRY[j], null); } if ((entMsg == null) && (numEntryAttached == 1)) { // Price level fields are probably be in the main message. entMsg = plMsg; } if (entMsg != null) { if (!getEntriesInfo(entMsg)) { return; } if (isRecap) { mLevelEntryHandler.onBookAtomicLevelEntryRecap( subscription, this, msg, this); } else { mLevelEntryHandler.onBookAtomicLevelEntryDelta( subscription, this, msg, this); } } } } } }
private void handleTradeMsg( MamdaOptionContract contract, MamdaSubscription subscription, MamaMsg msg, mamaMsgType msgType) { MamdaTradeListener tradeListener = contract.getTradeListener(); if (tradeListener != null) { tradeListener.onMsg(subscription, msg, msgType); } }
public void onQuoteUpdate( MamdaSubscription subscription, MamdaQuoteListener listener, MamaMsg msg, MamdaQuoteUpdate update, MamdaQuoteRecap recap) { myShortSaleCircuitBreaker = update.getShortSaleCircuitBreaker(); Console.WriteLine("myShortSaleCircuitBreaker: " + myShortSaleCircuitBreaker); }
private MamdaOptionContract findContract( MamdaSubscription subscription, MamaMsg msg) { /* * NOTE: fields which are enums can be pubished as integers if feedhandler * uses mama-publish-enums-as-ints. It may also be possible for a feed to * publish the numerical value as a string. All enumerated fields must be handled * by getting the value based on the field type. */ // Look up the strike price and expiration date string contractSymbol = null; if (!msg.tryString(MamdaOptionFields.CONTRACT_SYMBOL, ref contractSymbol)) { throw new MamdaDataException("cannot find contract symbol"); } string fullSymbol = contractSymbol; MamdaOptionContract contract = mChain.getContract(fullSymbol); if (contract == null) { string expireDateStr = String.Empty; double strikePrice = 0.0; string putCall = String.Empty; uint openInterest = 0; msg.tryString(MamdaOptionFields.EXPIRATION_DATE, ref expireDateStr); msg.tryF64(MamdaOptionFields.STRIKE_PRICE, ref strikePrice); if (msg.tryField(MamdaOptionFields.PUT_CALL, ref tmpfield_)) { putCall = getFieldAsString(tmpfield_); } int symbolLen = fullSymbol.Length; string symbol = null; string exchange = null; int dotIndex = fullSymbol.LastIndexOf('.'); if (dotIndex > 0) { // Have exchange in symbol. exchange = fullSymbol.Substring(dotIndex + 1); symbol = fullSymbol.Substring(0, dotIndex); } else { exchange = ""; symbol = fullSymbol; } DateTime expireDate = DateTime.MinValue; try { expireDate = mDateFormat.Parse(expireDateStr); } catch (FormatException e) { throw new MamdaDataException( String.Format("cannot parse expiration date: {0}", expireDateStr)); } MamdaOptionContract.PutOrCall putCallchar = extractPutCall(msg, fullSymbol); contract = new MamdaOptionContract( symbol, exchange, expireDate, strikePrice, putCallchar); MamdaOptionContract.ExerciseStyle exerciseStyleChar = extractExerciseStyle(msg, fullSymbol); contract.setExerciseStyle(exerciseStyleChar); if (msg.tryU32(MamdaOptionFields.OPEN_INTEREST, ref openInterest)) { contract.setOpenInterest((long)openInterest); } mChain.addContract(fullSymbol, contract); mLastActionContract = contract; mLastActionContractFieldState = MamdaFieldState.MODIFIED; mLastAction = MamdaOptionAction.Add; mLastActionFieldState = MamdaFieldState.MODIFIED; foreach (MamdaOptionChainHandler handler in mHandlers) { handler.onOptionContractCreate(subscription, this, msg, contract, mChain); } } return(contract); }
/// <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) { } }
/// <summary> /// Generic method for dispatching messages to instances of /// MamaMsgListeners. /// </summary> /// <param name="listeners"></param> /// <param name="subscription"></param> /// <param name="msg"></param> /// <param name="msgType"></param> private void forwardMsg( ArrayList listeners, MamdaSubscription subscription, MamaMsg msg, mamaMsgType msgType) { foreach (MamdaMsgListener listener in listeners) { listener.onMsg(subscription, msg, msgType); } }
public void onDestroy( MamaSubscription subscription) { subscription.deallocate(); mSubscription = null; }
private void handleClear(MamdaSubscription subscription, MamaMsg msg) { handleStandardFields(subscription, msg, false); invokeClearHandlers(subscription, msg); }
public void onTradeReport( MamdaSubscription sub, MamdaTradeListener listener, MamaMsg msg, MamdaTradeReport trade, MamdaTradeRecap recap) { }
/// <summary> /// Handler option chain recaps and initial values. /// </summary> /// <param name="subscription"></param> /// <param name="listener"></param> /// <param name="msg"></param> /// <param name="chain"></param> public void onOptionChainRecap( MamdaSubscription subscription, MamdaOptionChainListener listener, MamaMsg msg, MamdaOptionChain chain) { resetRange(); }
public void onError( MamdaSubscription subscription, MamdaErrorSeverity severity, MamdaErrorCode errorCode, string errorStr) { }
/// <summary> /// Handler for option chain structural updates. /// </summary> /// <param name="subscription"></param> /// <param name="listener"></param> /// <param name="msg"></param> /// <param name="contract"></param> /// <param name="chain"></param> public void onOptionContractCreate( MamdaSubscription subscription, MamdaOptionChainListener listener, MamaMsg msg, MamdaOptionContract contract, MamdaOptionChain chain) { resetRange(); }
public void onStale( MamdaSubscription subscription, mamaQuality quality) { }
/// <summary> /// Handler for option chain structural updates. /// </summary> /// <param name="subscription"></param> /// <param name="listener"></param> /// <param name="msg"></param> /// <param name="updateEvent"></param> /// <param name="chain"></param> public void onOptionSeriesUpdate( MamdaSubscription subscription, MamdaOptionChainListener listener, MamaMsg msg, MamdaOptionSeriesUpdate updateEvent, MamdaOptionChain chain) { resetRange(); }
/* End Field State Accessors */ private void handleQuoteMsg( MamdaOptionContract contract, MamdaSubscription subscription, MamaMsg msg, mamaMsgType msgType) { MamdaQuoteListener quoteListener = contract.getQuoteListener(); if (quoteListener != null) { quoteListener.onMsg(subscription, msg, msgType); } }
public void onQuoteUpdate( MamdaSubscription sub, MamdaQuoteListener listener, MamaMsg msg, MamdaQuoteUpdate updateEvent, MamdaQuoteRecap recap) { }
private MamdaOptionContract findContract( MamdaSubscription subscription, MamaMsg msg) { /* * NOTE: fields which are enums can be pubished as integers if feedhandler * uses mama-publish-enums-as-ints. It may also be possible for a feed to * publish the numerical value as a string. All enumerated fields must be handled * by getting the value based on the field type. */ // Look up the strike price and expiration date string contractSymbol = null; if (!msg.tryString(MamdaOptionFields.CONTRACT_SYMBOL, ref contractSymbol)) { throw new MamdaDataException ("cannot find contract symbol"); } string fullSymbol = contractSymbol; MamdaOptionContract contract = mChain.getContract(fullSymbol); if (contract == null) { string expireDateStr = String.Empty; double strikePrice = 0.0; string putCall = String.Empty; uint openInterest = 0; msg.tryString(MamdaOptionFields.EXPIRATION_DATE, ref expireDateStr); msg.tryF64(MamdaOptionFields.STRIKE_PRICE, ref strikePrice); if (msg.tryField (MamdaOptionFields.PUT_CALL, ref tmpfield_)) { putCall = getFieldAsString(tmpfield_); } int symbolLen = fullSymbol.Length; string symbol = null; string exchange = null; int dotIndex = fullSymbol.LastIndexOf('.'); if (dotIndex > 0) { // Have exchange in symbol. exchange = fullSymbol.Substring(dotIndex + 1); symbol = fullSymbol.Substring(0, dotIndex); } else { exchange = ""; symbol = fullSymbol; } DateTime expireDate = DateTime.MinValue; try { expireDate = mDateFormat.Parse(expireDateStr); } catch (FormatException e) { throw new MamdaDataException ( String.Format("cannot parse expiration date: {0}", expireDateStr)); } MamdaOptionContract.PutOrCall putCallchar = extractPutCall(msg,fullSymbol); contract = new MamdaOptionContract( symbol, exchange, expireDate, strikePrice, putCallchar); MamdaOptionContract.ExerciseStyle exerciseStyleChar = extractExerciseStyle(msg,fullSymbol); contract.setExerciseStyle(exerciseStyleChar); if (msg.tryU32 (MamdaOptionFields.OPEN_INTEREST, ref openInterest)) { contract.setOpenInterest( (long)openInterest ); } mChain.addContract(fullSymbol, contract); mLastActionContract = contract; mLastActionContractFieldState = MamdaFieldState.MODIFIED; mLastAction = MamdaOptionAction.Add; mLastActionFieldState = MamdaFieldState.MODIFIED; foreach (MamdaOptionChainHandler handler in mHandlers) { handler.onOptionContractCreate(subscription, this, msg, contract, mChain); } } return contract; }
public void onTradeCancelOrError( MamdaSubscription sub, MamdaTradeListener listener, MamaMsg msg, MamdaTradeCancelOrError cancelEvent, MamdaTradeRecap recap) { }
public MamdaSubscriptionCallback(MamdaSubscription subscription) { mSubscription = subscription; }
private void handleUpdate(MamdaSubscription subscription, MamaMsg msg) { handleStandardFields(subscription, msg, false); createDeltaFromMamaMsg(subscription, msg, false); }