Пример #1
0
 public void onMsg(
     MamdaSubscription subscription,
     MamaMsg msg,
     mamaMsgType msgType)
 {
     Console.WriteLine("Update ({0})", subscription.getSymbol());
 }
 public void onTradeRecap(
     MamdaSubscription sub,
     MamdaTradeListener listener,
     MamaMsg msg,
     MamdaTradeRecap recap)
 {
     prettyPrint("Trade Recap ({0}): ", sub.getSymbol());
 }
 public void onQuoteRecap(
     MamdaSubscription subscription,
     MamdaQuoteListener listener,
     MamaMsg msg,
     MamdaQuoteRecap recap)
 {
     prettyPrint("Quote Recap ({0})", subscription.getSymbol());
 }
 public void onSecurityStatusRecap(
     MamdaSubscription subscription,
     MamdaSecurityStatusListener listener,
     MamaMsg msg,
     MamdaSecurityStatusRecap recap)
 {
     prettyPrint("SecStatus recap ({0} - {1})", subscription.getSymbol(), recap.getSecurityStatusStr());
 }
Пример #5
0
 public void onQuoteRecap(
     MamdaSubscription subscription,
     MamdaQuoteListener listener,
     MamaMsg msg,
     MamdaQuoteRecap recap)
 {
     Console.WriteLine("Quote Recap ({0})", subscription.getSymbol());
 }
Пример #6
0
 public void onTradeRecap(
     MamdaSubscription sub,
     MamdaTradeListener listener,
     MamaMsg msg,
     MamdaTradeRecap recap)
 {
     Console.WriteLine("Trade Recap ({0}): ", sub.getSymbol());
 }
 public void onError(
     MamdaSubscription subscription,
     MamdaErrorSeverity severity,
     MamdaErrorCode errorCode,
     string errorStr)
 {
     Console.WriteLine("Error ({0})", subscription.getSymbol());
 }
Пример #8
0
 public void onSecurityStatusRecap(
     MamdaSubscription subscription,
     MamdaSecurityStatusListener listener,
     MamaMsg msg,
     MamdaSecurityStatusRecap recap)
 {
     Console.WriteLine("SecStatus recap (" + subscription.getSymbol()
                       + "    Status:" + recap.getSecurityStatusStr());
 }
 public void onTradeCancelOrError(
     MamdaSubscription sub,
     MamdaTradeListener listener,
     MamaMsg msg,
     MamdaTradeCancelOrError cancelOrError,
     MamdaTradeRecap recap)
 {
     prettyPrint("Trade error/cancel ({0}):", sub.getSymbol());
 }
Пример #10
0
 public void onSecurityStatusUpdate(
     MamdaSubscription subscription,
     MamdaSecurityStatusListener listener,
     MamaMsg msg,
     MamdaSecurityStatusUpdate update,
     MamdaSecurityStatusRecap recap)
 {
     prettyPrint("SecStatus update ({0} - {1}", subscription.getSymbol(), listener.getSecurityStatusStr());
 }
Пример #11
0
 public void onQuoteClosing(
     MamdaSubscription sub,
     MamdaQuoteListener listener,
     MamaMsg msg,
     MamdaQuoteClosing closingEvent,
     MamdaQuoteRecap recap)
 {
     Console.WriteLine("Quote Closing (" + sub.getSymbol() + "): ");
 }
Пример #12
0
 public void onTradeCancelOrError(
     MamdaSubscription sub,
     MamdaTradeListener listener,
     MamaMsg msg,
     MamdaTradeCancelOrError cancelOrError,
     MamdaTradeRecap recap)
 {
     Console.WriteLine("Trade error/cancel (" + sub.getSymbol() + "): ");
 }
Пример #13
0
 public void onTradeCorrection(
     MamdaSubscription sub,
     MamdaTradeListener listener,
     MamaMsg msg,
     MamdaTradeCorrection correction,
     MamdaTradeRecap recap)
 {
     Console.WriteLine("Trade correction (" + sub.getSymbol() + "): ");
 }
Пример #14
0
 public void onError(
     MamdaSubscription subscription,
     MamdaErrorSeverity severity,
     MamdaErrorCode errorCode,
     string errorStr)
 {
     prettyPrint("Error ({0}): {1} ({2})",
                 subscription.getSymbol(),
                 MamdaErrorCodes.stringForMamdaError(errorCode),
                 errorStr);
 }
            public void onBookAtomicBeginBook(
                MamdaSubscription subscription,
                MamdaBookAtomicListener listener,
                bool isRecap)

            {
                if (myQuietModeLevel < 2)
                {
                    Console.WriteLine("BEGIN BOOK - " + subscription.getSymbol());
                }
            }
Пример #16
0
 public void onError(
     MamdaSubscription subscription,
     MamdaErrorSeverity severity,
     MamdaErrorCode errorCode,
     String errorStr)
 {
     Console.WriteLine("Error ({0}): {1} ({2})",
                       subscription.getSymbol(),
                       MamdaErrorCodes.stringForMamdaError(errorCode),
                       errorStr);
 }
 public void onBookAtomicClear(
     MamdaSubscription subscription,
     MamdaBookAtomicListener listener,
     MamaMsg msg)
 {
     if (myQuietModeLevel < 2)
     {
         Console.WriteLine("BOOK CLEAR - " + subscription.getSymbol());
         Console.WriteLine();
     }
 }
 public void onFundamentals(
     MamdaSubscription subscription,
     MamdaFundamentalListener listener,
     MamaMsg msg,
     MamdaFundamentals fundamentals)
 {
     Console.WriteLine("Fundamental update (" + subscription.getSymbol() +
                       "    wDivFreq:" + fundamentals.getDividendFrequency() +
                       "    wMarketSector:" + fundamentals.getMarketSector() +
                       "    wMarketSegment:" + fundamentals.getMarketSegment()
                       );
 }
Пример #19
0
 public void onBookGap(
     MamdaSubscription sub,
     MamdaOrderBookListener listener,
     MamaMsg msg,
     MamdaOrderBookGap gapEvent,
     MamdaOrderBookRecap fullBook)
 {
     Console.WriteLine(
         "Received book gap " + sub.getSymbol()
         + " Start: " + gapEvent.getBeginGapSeqNum()
         + " End: " + gapEvent.getEndGapSeqNum());
 }
Пример #20
0
 public void onError(
     MamdaSubscription subscription,
     MamdaErrorSeverity severity,
     MamdaErrorCode errorCode,
     String errorMessage)
 {
     if (myQuiteModeLevel < 2)
     {
         Console.WriteLine("Error (" + subscription.getSymbol() + "): "
                           + errorMessage);
     }
 }
            void prettyPrint(MamdaSubscription subscription,
                             MamdaBookAtomicLevelEntry levelEntry)
            {
                // Print Entry Level Info
                string symbol        = subscription.getSymbol();
                long   actNumEntries = levelEntry.getPriceLevelActNumEntries();
                char   entryAction   = levelEntry.getPriceLevelEntryAction();
                string entryId       = levelEntry.getPriceLevelEntryId();
                long   entrySize     = levelEntry.getPriceLevelEntrySize();

                Console.WriteLine("\tENTRY | " + symbol + " | " + actNumEntries + " | "
                                  + entryAction + " | " + entryId + " | " + entrySize);
            }
 public void onBookAtomicGap(
     MamdaSubscription subscription,
     MamdaBookAtomicListener listener,
     MamaMsg msg,
     MamdaBookAtomicGap gapEvent)
 {
     if (myQuietModeLevel < 2)
     {
         Console.WriteLine("BOOK GAP - " + subscription.getSymbol());
         Console.WriteLine("Begin Gap: " + listener.getBeginGapSeqNum());
         Console.WriteLine("End Gap  : " + listener.getEndGapSeqNum());
         Console.WriteLine();
     }
 }
 public void onBookAtomicEndBook(
     MamdaSubscription subscription,
     MamdaBookAtomicListener listener)
 {
     if (myQuietModeLevel < 2)
     {
         if (listener.getPriceLevelNumLevels() == 0)
         {
             Console.WriteLine();
             Console.WriteLine("END BOOK - " + subscription.getSymbol());
             Console.WriteLine(" - empty book message !!!");
             Console.WriteLine();
             Console.WriteLine();
         }
         else
         {
             Console.WriteLine();
             Console.WriteLine("END BOOK - " + subscription.getSymbol());
             Console.WriteLine();
             Console.WriteLine();
         }
     }
 }
 public void onAuctionRecap(
     MamdaSubscription subscription,
     MamdaAuctionListener listener,
     MamaMsg msg,
     MamdaAuctionRecap recap)
 {
     Console.WriteLine("Auction Recap ({0}, Uncross Price {1}({2}), Uncross Vol {3}({4}), Ind {5}({6})",
                       subscription.getSymbol(),
                       recap.getUncrossPrice(),
                       recap.getUncrossPriceFieldState(),
                       recap.getUncrossVolume(),
                       recap.getUncrossVolumeFieldState(),
                       recap.getUncrossPriceInd(),
                       recap.getUncrossPriceIndFieldState());
 }
Пример #25
0
 public void onTradeReport(
     MamdaSubscription sub,
     MamdaTradeListener listener,
     MamaMsg msg,
     MamdaTradeReport trade,
     MamdaTradeRecap recap)
 {
     prettyPrint(
         "Trade ({0}:{1}): {2} @ {3} (seq#: {4}; time: {5}; acttime: {6}; qual: {7})",
         sub.getSymbol(),
         recap.getTradeCount(),
         trade.getTradeVolume(),
         trade.getTradePrice(),
         trade.getEventSeqNum(),
         trade.getEventTime(),
         trade.getActivityTime(),
         trade.getTradeQual());
 }
            void prettyPrint(MamdaSubscription subscription,
                             MamdaBookAtomicLevel level)
            {
                // Price Level Info
                double  price      = level.getPriceLevelPrice();
                decimal dPrice     = System.Convert.ToDecimal(price);
                string  roundPrice = (Decimal.Round(dPrice, 2)).ToString("0.00");

                string   symbol     = subscription.getSymbol();
                double   size       = level.getPriceLevelSize();
                char     action     = level.getPriceLevelAction();
                char     side       = level.getPriceLevelSide();
                double   numEntries = level.getPriceLevelNumEntries();
                DateTime levelTime  = level.getPriceLevelTime();

                Console.WriteLine();
                Console.WriteLine("LEVEL | " + symbol + " | " + roundPrice + " | " + size + " | "
                                  + action + " | " + side + " | " + numEntries + " | " + "{0:HH:mm:ss.fff}", levelTime);
            }
Пример #27
0
            public void onQuoteUpdate(
                MamdaSubscription subscription,
                MamdaQuoteListener listener,
                MamaMsg msg,
                MamdaQuoteUpdate update,
                MamdaQuoteRecap recap)
            {
                string format = "Quote ({0}:{1}): {2} {3} X {4} {5} (seq#: {6}; time: {7}; qual: {8})";

                Console.WriteLine(format,
                                  subscription.getSymbol(),
                                  recap.getQuoteCount(),
                                  update.getBidPrice(),
                                  update.getBidSize(),
                                  update.getAskSize(),
                                  update.getAskPrice(),
                                  update.getEventSeqNum(),
                                  update.getEventTime(),
                                  update.getQuoteQual());
            }
Пример #28
0
 private void onTimerImpl()
 {
     myNumToChurn = myChurnRate;
     while (myNumToChurn-- > 0)
     {
         myRandomNo = generator.Next(65536) % options.getSymbolListSize();
         //Accessing the mamda subscription object from the arrayList
         try
         {
             sub = (MamdaSubscription)subscriptionList[myRandomNo];
             subscriptionList.RemoveAt(myRandomNo);
             tempSymbol = sub.getSymbol();
             if (tempSymbol != null)
             {
                 //Deactivating the Mamda Subscription
                 sub.deactivate();
                 //Creating the MamdaSubscription
                 subscribeToBooks(tempSymbol);
                 ++myChurnStats;
             }
         }
         catch (Exception e)
         {
             Console.WriteLine("Error: {0}", e.ToString());
         }
     }
 }
Пример #29
0
            public void onError(
				MamdaSubscription   subscription,
				MamdaErrorSeverity	severity,
				MamdaErrorCode		errorCode,
				String              errorStr)
            {
                Console.WriteLine("Error ({0}): {1} ({2})",
                    subscription.getSymbol(),
                    MamdaErrorCodes.stringForMamdaError(errorCode),
                    errorStr);
            }
Пример #30
0
            public void onStale(
				MamdaSubscription   subscription,
				mamaQuality         quality)
            {
                prettyPrint("Stale ({0} - {1})", subscription.getSymbol(), quality);
            }
Пример #31
0
            public void onSecurityStatusRecap(
				MamdaSubscription            subscription,
				MamdaSecurityStatusListener  listener,
				MamaMsg                      msg,
				MamdaSecurityStatusRecap     recap)
            {
                prettyPrint("SecStatus recap ({0} - {1})", subscription.getSymbol(), recap.getSecurityStatusStr ());
            }
Пример #32
0
            public void onError(
				MamdaSubscription   subscription,
				MamdaErrorSeverity	severity,
				MamdaErrorCode		errorCode,
				String              errorMessage)
            {
                if (myQuiteModeLevel < 2)
                {
                    Console.WriteLine ("Error (" + subscription.getSymbol() + "): "
                        + errorMessage);
                }
            }
Пример #33
0
            public void onError(
				MamdaSubscription   subscription,
				MamdaErrorSeverity  severity,
				MamdaErrorCode      errorCode,
				string              errorStr)
            {
                prettyPrint("Error ({0}): {1} ({2})",
                    subscription.getSymbol(),
                    MamdaErrorCodes.stringForMamdaError(errorCode),
                    errorStr);
            }
Пример #34
0
            public void onFundamentals(
			MamdaSubscription         subscription,
			MamdaFundamentalListener  listener,
			MamaMsg                   msg,
			MamdaFundamentals         fundamentals)
            {
                Console.WriteLine ("Fundamental update (" + subscription.getSymbol() +
                                   "    wDivFreq:" + fundamentals.getDividendFrequency() +
                                   "    wMarketSector:" + fundamentals.getMarketSector() +
                                   "    wMarketSegment:" + fundamentals.getMarketSegment()
                                    );
            }
Пример #35
0
 public void onBookAtomicClear(
     MamdaSubscription           subscription,
     MamdaBookAtomicListener     listener,
     MamaMsg                     msg)
 {
     if (myQuietModeLevel<2)
     {
          Console.WriteLine ("BOOK CLEAR - " + subscription.getSymbol () );
          Console.WriteLine ();
     }
 }
Пример #36
0
            public void onError(
				MamdaSubscription   subscription,
				MamdaErrorSeverity  severity,
				MamdaErrorCode      errorCode,
				string              errorStr)
            {
                Console.WriteLine("Error (" + subscription.getSymbol() + ")");
            }
Пример #37
0
            public void onAuctionUpdate(
				MamdaSubscription   subscription,
				MamdaAuctionListener  listener,
				MamaMsg             msg,
				MamdaAuctionUpdate    update,
				MamdaAuctionRecap     recap)
            {
                Console.WriteLine("Auction Update ({0}, Uncross Price {1}({2}), Uncross Vol {3}({4}), Ind {5}({6})",
                                  subscription.getSymbol(),
                                  update.getUncrossPrice(),
                                  update.getUncrossPriceFieldState(),
                                  update.getUncrossVolume(),
                                  update.getUncrossVolumeFieldState(),
                                  update.getUncrossPriceInd(),
                                  update.getUncrossPriceIndFieldState());
            }
Пример #38
0
 public void onStale(
     MamdaSubscription subscription,
     mamaQuality quality)
 {
     prettyPrint("Stale ({0} - {1})", subscription.getSymbol(), quality);
 }
Пример #39
0
 public void onStale(
     MamdaSubscription subscription,
     mamaQuality quality)
 {
     Console.WriteLine("Stale (" + subscription.getSymbol() + ")");
 }
Пример #40
0
            public void onBookGap(
				MamdaSubscription        sub,
				MamdaOrderBookListener   listener,
				MamaMsg                  msg,
				MamdaOrderBookGap        gapEvent,
				MamdaOrderBookRecap      fullBook)
            {
                Console.WriteLine (
                    "Received book gap " + sub.getSymbol ()
                        + " Start: " + gapEvent.getBeginGapSeqNum()
                        + " End: "   + gapEvent.getEndGapSeqNum());
            }
Пример #41
0
            public void onQuoteRecap(
				MamdaSubscription   subscription,
				MamdaQuoteListener  listener,
				MamaMsg             msg,
				MamdaQuoteRecap     recap)
            {
                prettyPrint("Quote Recap ({0})", subscription.getSymbol());
            }
Пример #42
0
 public void onBookAtomicEndBook(
     MamdaSubscription           subscription,
     MamdaBookAtomicListener     listener)
 {
     if (myQuietModeLevel<2)
     {
         if (listener.getPriceLevelNumLevels () == 0)
         {
             Console.WriteLine ();
             Console.WriteLine ( "END BOOK - " + subscription.getSymbol () );
             Console.WriteLine ( " - empty book message !!!" );
             Console.WriteLine ();
             Console.WriteLine ();
         }
         else
         {
           Console.WriteLine ();
           Console.WriteLine ( "END BOOK - " + subscription.getSymbol () );
           Console.WriteLine ();
           Console.WriteLine ();
         }
     }
 }
 public void onStale(
     MamdaSubscription subscription,
     mamaQuality quality)
 {
     Console.WriteLine("Stale ({0} - {1})", subscription.getSymbol(), quality);
 }
Пример #44
0
            public void onTradeRecap(
				MamdaSubscription   sub,
				MamdaTradeListener  listener,
				MamaMsg             msg,
				MamdaTradeRecap     recap)
            {
                prettyPrint("Trade Recap ({0}): ", sub.getSymbol());
            }
Пример #45
0
 public void onBookAtomicGap(
     MamdaSubscription              subscription,
     MamdaBookAtomicListener        listener,
     MamaMsg                        msg,
     MamdaBookAtomicGap             gapEvent)
 {
     if (myQuietModeLevel<2)
     {
         Console.WriteLine ( "BOOK GAP - " + subscription.getSymbol () );
         Console.WriteLine ( "Begin Gap: " + listener.getBeginGapSeqNum () );
         Console.WriteLine ( "End Gap  : " + listener.getEndGapSeqNum () );
         Console.WriteLine ();
     }
 }
Пример #46
0
            public void onSecurityStatusUpdate(
				MamdaSubscription            subscription,
				MamdaSecurityStatusListener  listener,
				MamaMsg                      msg,
				MamdaSecurityStatusUpdate    update,
				MamdaSecurityStatusRecap     recap)
            {
                prettyPrint("SecStatus update ({0} - {1}", subscription.getSymbol (), listener.getSecurityStatusStr ());
            }
Пример #47
0
            public void onQuoteRecap(
				MamdaSubscription   subscription,
				MamdaQuoteListener  listener,
				MamaMsg             msg,
				MamdaQuoteRecap     recap)
            {
                Console.WriteLine("Quote Recap ({0})", subscription.getSymbol());
            }
Пример #48
0
            public void onTradeReport(
				MamdaSubscription   sub,
				MamdaTradeListener  listener,
				MamaMsg             msg,
				MamdaTradeReport    trade,
				MamdaTradeRecap     recap)
            {
                prettyPrint(
                    "Trade ({0}:{1}): {2} @ {3} (seq#: {4}; time: {5}; acttime: {6}; qual: {7})",
                    sub.getSymbol(),
                    recap.getTradeCount(),
                    trade.getTradeVolume(),
                    trade.getTradePrice(),
                    trade.getEventSeqNum(),
                    trade.getEventTime(),
                    trade.getActivityTime(),
                    trade.getTradeQual());
            }
Пример #49
0
            public void onQuoteUpdate(
				MamdaSubscription   subscription,
				MamdaQuoteListener  listener,
				MamaMsg             msg,
				MamdaQuoteUpdate    update,
				MamdaQuoteRecap     recap)
            {
                string format = "Quote ({0}:{1}): {2} {3} X {4} {5} (seq#: {6}; time: {7}; qual: {8})";
                Console.WriteLine(format,
                    subscription.getSymbol(),
                    recap.getQuoteCount(),
                    update.getBidPrice(),
                    update.getBidSize(),
                    update.getAskSize(),
                    update.getAskPrice(),
                    update.getEventSeqNum(),
                    update.getEventTime(),
                    update.getQuoteQual());
            }
Пример #50
0
 public void onSecurityStatusUpdate(
     MamdaSubscription            subscription,
     MamdaSecurityStatusListener  listener,
     MamaMsg                      msg,
     MamdaSecurityStatusUpdate    update,
     MamdaSecurityStatusRecap     recap)
 {
     Console.WriteLine ("SecStatus update (" + subscription.getSymbol ()
      + "    Status:" + listener.getSecurityStatusStr ());
 }
Пример #51
0
            public void onTradeRecap(
				MamdaSubscription   sub,
				MamdaTradeListener  listener,
				MamaMsg             msg,
				MamdaTradeRecap     recap)
            {
                Console.WriteLine("Trade Recap ({0}): ", sub.getSymbol());
            }
Пример #52
0
            void prettyPrint(MamdaSubscription subscription, 
                            MamdaBookAtomicLevel level)
            {
                // Price Level Info
                double  price      = level.getPriceLevelPrice ();
                decimal dPrice     = System.Convert.ToDecimal(price);
                string  roundPrice = (Decimal.Round(dPrice,2)).ToString("0.00");

                string   symbol     = subscription.getSymbol ();
                double   size       = level.getPriceLevelSize ();
                char     action     = level.getPriceLevelAction ();
                char     side       = level.getPriceLevelSide ();
                double   numEntries = level.getPriceLevelNumEntries ();
                DateTime levelTime  = level.getPriceLevelTime();

                Console.WriteLine ();
                Console.WriteLine ( "LEVEL | " + symbol + " | " + roundPrice + " | " + size + " | "
                    + action + " | " + side + " | " + numEntries + " | " + "{0:HH:mm:ss.fff}", levelTime);
            }
Пример #53
0
            void prettyPrint(MamdaSubscription subscription,
                            MamdaBookAtomicLevelEntry levelEntry)
            {
                // Print Entry Level Info
                string	symbol        = subscription.getSymbol ();
                long	actNumEntries = levelEntry.getPriceLevelActNumEntries ();
                char	entryAction   = levelEntry.getPriceLevelEntryAction ();
                string  entryId       = levelEntry.getPriceLevelEntryId ();
                long    entrySize     = levelEntry.getPriceLevelEntrySize ();

                Console.WriteLine ("\tENTRY | " + symbol + " | " + actNumEntries + " | "
                    + entryAction + " | " + entryId + " | " + entrySize );
            }
Пример #54
0
            public void onError(
				MamdaSubscription subscription,
				MamdaErrorSeverity severity,
				MamdaErrorCode errorCode,
				string errorMessage)
            {
                Console.WriteLine("Error ({0})", subscription.getSymbol());
            }
Пример #55
0
            public void onTradeCancelOrError(
				MamdaSubscription        sub,
				MamdaTradeListener       listener,
				MamaMsg                  msg,
				MamdaTradeCancelOrError  cancelOrError,
				MamdaTradeRecap          recap)
            {
                prettyPrint("Trade error/cancel ({0}):", sub.getSymbol());
            }
Пример #56
0
            public void onStale(
				MamdaSubscription   subscription,
				mamaQuality         quality)
            {
                Console.WriteLine("Stale ({0} - {1})", subscription.getSymbol(), quality);
            }
Пример #57
0
            public void onMsg(
				MamdaSubscription subscription,
				MamaMsg msg,
				mamaMsgType msgType)
            {
                Console.WriteLine("Update ({0})", subscription.getSymbol());
            }
Пример #58
0
            public void onStale(
				MamdaSubscription   subscription,
				mamaQuality         quality)
            {
                Console.WriteLine("Stale (" + subscription.getSymbol() + ")");
            }
Пример #59
0
 public void onBookAtomicBeginBook(
     MamdaSubscription           subscription,
     MamdaBookAtomicListener     listener,
     bool                     isRecap)
 {
     if (myQuietModeLevel<2)
     {
          Console.WriteLine ("BEGIN BOOK - " + subscription.getSymbol ());
     }
 }