JTools Table of Contents

Project Location: \JTools_PulsarMonitor

Over the years I have written many systems that distribute real time data streams on a 'symbol interest' basis (IE not a whole market stream). One of the servers I developed (and continue to develop) uses the concept of 'pulsed' quotes and trades (a concept used in practice by many). In today's environment, even non liquid stocks can see quote rates exceeding 5000+ quotes per second, which can place an enormous load of both server and client software. As opposed to sending out every quote and trade, pulsed systems send out quotes and trades on a regular timed interval, which usually ranges anywhere from 100 milliseconds to 1 second. In doing this, considerable bandwidth in both delivery and processing of data is saved.

The Pulsar Monitor demonstrates this concept by pulsing quotes/trades to a GUI which represents the type of system appropriate for pulsed data, which is a basic monitor containing user defined symbols, updating on a real time basis with composite trade and quote data.
  • The application is possible due to NxCore's extremely accurate (25 milliseconds resolution) internal clock and timer.

  • Only symbols with interest set (IE being watched) are processing trade and quote messages. Composite data is allocated for a symbol when a request is made for the symbol (or read from 'monitor.txt' at startup) and only issues with composite data allocated go through the quote/trade handlers. When a symbol loses interest (deleted by the user) the composite data is freed.

  • A simple linked list is maintained throughout the life of the system which binds together all composite data (and symbol interests) allocated. When a time period is hit that specifies sending data to the GUI, the list is parsed from start to finish and if there have been any new trades or quotes during the time period they are sent to the GUI. If no new trades or quotes have been reported during the period the symbol is skipped over.

  • For this specific application, the GUI and the NxCore interface share some data that allows the GUI to never perform a lookup as to which row a particular symbol is located in. Since composite data is allocated for each symbol that the user is interested in, that data also includes the row the user set the symbol in and carries it through to the GUI in each update.

  • With a little imagination it should become clear how one could use the underlying 'pulsing' system to easy provide such a service for themselves or for clients they might distribute data to. In fact this application is actually a modification of a client app I wrote that listens to one of the pulsed servers mentioned above. I have removed the server-client communication code and replaced it with pure NxCore code which performs the same functionality as a pulsed server (within the context of this particular application).
The app lets you modify the pulse rate at 100 ms, 200 ms, 250 ms, 500 ms or 1 second. You may change the rate while the application is running to see the difference in performance and visual updating. Stats are also presented regarding how many actual trades, quotes and BBO changes there were during the time interval. Looked at another way, these are counts of messages the application did *not* need to send to the GUI for processing (and in the case of a pulsed server, the messages would not need to be sent to a client).

You may enter up to 100 symbols into the list (which could easily be extended to thousands if desired).

The Pulsar Monitor running in 250 millisecond intervals:

List Fields:
  • Symbol - Symbol of the issue being plotted.
  • Last - Last Trade Price
  • Net Chg - Net Change.
  • Volume - Total Volume.
  • LTrdTime - Last trade time.
  • Bid - Current Bid Price (Best Bid for equities).
  • Ask - Current Ask Price (Best Ask for equities)
  • LQteTime - Last Quote Time.
  • NumTrds - Number of trades in the last time interval.
  • NumQtes - Number of quotes in the last time interval.
  • BOChanges - Number of BBO changes in the last time interval.
  • Pulse Rate- Interval of time to data is sent to the GUI.
  • autosnap - Snaps the column widths of fields to the smallest size that will contain complete data in each row

Shown with a one second pulse interval set:

To add a symbol, right click on a blank row and choose "Add Symbol".:

A dialog will pop up allowing you to enter the new symbol:

To modify or delete a symbol from a row, right click on a populated row and choose either "Del Symbol" to delete the symbol or "Mod Symbol" to change the symbol.

The symbols that you enter are saved to a file called "PulsarSymbols.txt". The file is read and the list repopulated with your symbols when the application is relaunched.

Symbol Convention:

The initial Pulsar application was intended to by used and tested by traders, not developers. Traders are usually not familiar with NxCore's symbology and as such requested a new format. This format is similar to other I have used when writing applications for traders, and is quite simple:
  • All equities are simply entered in as the symbol. For instance "AAPL" for the stock APPLE INC (as opposed to NxCore's native format of "eAAPL".

  • Indexes are preceded with the character "$". For instance "$DJI" for the Dow 30 Index (as opposed to NxCore's native format of "iDJI".

  • Futures are preceded with the character "/". For instance "/ES.U12" for the SPY EMini contract-Sept 2012 (as opposed to NxCore's native format of "fES.U12".

  • Currencies are preceded with the character "@".
While the application currently supports Equities, Indexes, Futures and Currencies adding support for additional types should prove an easy task for any developer.

Furthermore, because a symbol may be duplicated on more than one listing exchange. For instance GE is listed on both the NYSE and Canadian exchange, and represent different companies. As an example of how to specify the listing exchange in the symbol:
  • GE or GE:3 - General Electric on the NYSE exchange (exchange # 3).
  • GE:19 - Granville Pacific Capital Corp on the CDNX exchange (exchange #19).

The exchange designators correspond to the default NxCore exchange codes found here: NxCore Exchange Codes

Colors and Additional Settings:

You may change colors for he entire application by clicking on the application icon in the upper left corner, and choosing 'Color Prefs':

JTools Table of Contents