Friday, December 14, 2007

Streambase (yet again ...)

After vowing to bypass Streambase in my CEP engine evaluation, I may be forced to eat crow. I agreed to let Streambase into the evaluation process because I need to have two CEP engines in my project ... one as primary and one as "cold backup". And, for various reasons, Aleri and Esper did not pan out for me.

The new CEO of Streambase, Chris Ridley, came down to New York to meet with me, with his chief architect, Richard Tibbetts, in tow. They acknowledged some of the errors of their over-aggressive marketing, and told me about their sharpened focus on the financial industry marketplace.

They also let me have an eval version of Streambase that is not constrained by any license key, and in the interests of expediency, they graciously allowed me to bypass their eval agreement (which would have taken weeks to make it through my company's legal processes at this time of the year).

I installed Streambase on my laptop. My first impressions are ..... "slick". In other words, all the superficial, glossy stuff that gives the initial impression to a prospective customer is all there. Nice documentation with plenty of graphics, a great interactive tutorial, etc. I was "warned" that Streambase puts a lot of time into their studio and help system, and I can definitely concur. Nice job, guys.

I am going through the tutorials now. Several things jump out at me right away:

1) They use Eclipse as the foundation of their Streambase Studio. I am quickly becoming a fan of Eclipse, especially the way that you can automatically update Eclipse plugins.

2) The development methodology is more "file-based" than the other products. A familiar paradigm to Java/C# developers.

3) There are two ways to develop apps. The Event Flow method uses a GUI-based method. You can also program in StreamSQL. Unfortunately, there is no tie-in between the Event Flow and the Stream SQL files. In other words, unlike Coral8, if you make a change in the Event Flow, it does not get reflected in the StreamSQL file. In your project, you can have multiple Event Flow files and multiple StreamSQL files. I would love to be able to develop in either system, and have them automatically translated to the other system.

4) There are certain things that you need to do in the Event Flow system that you cannot do in StreamSQL. There are comments in their demo programs to this effect. I would welcome a document that outlined these differences.

5) I noticed that the icons used in the tool palette are identical to the ones that Aleri uses. Interesting. Someone looked at the other company's product.

6) Richard Tibbetts and Mark Tzimelson are very respectful to each other's work. Nice to see that kind of respect at the technical level.


©2007 Marc Adler - All Rights Reserved

Tuesday, December 11, 2007

Acropolis Shrugged

http://blogs.msdn.com/gblock/archive/2007/12/07/if-acropolis-is-no-more-what-s-our-commitment.aspx

CAB? Acropolis? CAB? Acropolis? CAB? Acropolis? CAB? Acropolis? CAB? Acropolis?

It looks like Acropolis may be going by the wayside, and the Patterns and Practice Group has decided that, for today, they will refocus on CAB.

This is precisely why we build our own .NET frameworks in my investment bank. Because, we need a high quality framework that has some domain knowledge of what capital markets needs. Goldman, Wachovia and Morgan Stanley have done the same.

And, this time last year, Microsoft came in and tried to get us to adopt CAB, and the week after that, they told us that Acropolis was the new flavor of the day. Thank the lord that we were focused on a mission to build what we wanted and needed, without all of the background noise from Microsoft. (Sorry Joe...)





©2007 Marc Adler - All Rights Reserved

Get Rich Quick with KDB+

I am convinced that the world needs more KDB+ consultants. The supply of these creatures is so small, that if you end up needing one in a hurry, you probably have to go through First Derivatives.

KDB+ is used by most of the Wall Street companies --- I can name Citigroup, Barclays, Bank of America, and Lehman as big KDB+ users --- to store tick and order data. KDB+ 's biggest competitor is probably Vhayu.

The main blockade to learning KDB+ is their programming languages - K and Q - which can make APL look verbose!

If you are affected by the upcoming layoffs on Wall Street, and if you are looking for a new, exciting career change, and you don't relish the idea of selling steak knives door-to-door, then there is room in this world to be a KDB+ consultant.


©2007 Marc Adler - All Rights Reserved

Sunday, December 09, 2007

OpenAdaptor, SQL Server 2005, and Aleri

This posting was made in the interests of any Aleri or OpenAdaptor users who are trying to connect to a named SS2005 instance.

I have multiple "instances" installed of SQL Server 2005. According to the documentation at http://msdn2.microsoft.com/en-us/library/ms378428.aspx, this JDBC connection string should have worked:

jdbc:sqlserver://MAGMALAPTOP\RPT;databaseName=MyDatabase;integratedSecurity=true;

In Microsoft's JDBC Driver 1.2 for SQL Server 2005, there is a sample Java app called connectURL. With the connection string above, this sample app worked fine, and was able to connect to the RPT instance of my SS2005 database.

However, I could not get OpenAdaptor to work with this connect string. In case you are wondering why I was messing around with OpenAdaptor, it is because this is what Aleri uses for its adapters to external data sources.

After spending several hours this weekend trying to get Aleri to connect to SQL Server using the connection string above, I finally stumbled upon an alternative syntax for the connection string.

The new connection string is:

jdbc:sqlserver://MAGMALAPTOP;instanceName=RPT;databaseName=MyDatabase;integratedSecurity=true;

Notice that the instanceName is specified with a separate parameter.

So, there may be an issue with OpenAdaptor. Or, another theory that I have is that the backslash character in the connection string is being considered as an escape character.


©2007 Marc Adler - All Rights Reserved

Saturday, December 08, 2007

Getting intermediate results in Streams

Let's say that we want to keep a running total of the number of shares that we have traded, and at 4:00 PM every day, we want to dump out the total. In Coral8, we can do something like this:

CREATE LOCAL STREAM Totals (TotalShares INTEGER);

INSERT INTO Totals
SELECT SUM(shares)
FROM TradeInputStream KEEP EVERY 1 DAY OFFSET BY 16 HOURS
OUTPUT EVERY 1 DAY OFFSET BY 16 HOURS;

This looks pretty straightforward. The Totals stream retains the totals until 4:00PM. At 4:00 every day, it outputs the total shares to any other stream that is "subscribed" to Totals, and then resets itself to start accumulating new totals.

This is something that CEP engines are good at, whether it be Coral8, Aleri, or Esper.

Now, let's enhance this a little bit.

Let's say we give the traders a .NET GUI application, and on this GUI is a "Status" button. The traders can press this button any time they want to know how many shares have been traded so far that day. So, at 2:00, a trader pushes a button on the GUI and we need to return to him the number of orders seen so far that day, the number of shares seen, the notional value of all orders, etc.

So, there are two questions:

1) How can we "dump out" these accumulators on demand? In other words, is there a way to tell these CEP engines to give me the contents of an aggregation stream AS OF THIS MOMENT ?

2) How can we "call into" our CEP engine to retrieve these values? Do the CEP engines support an API that I can use from within the GUI to say "Give me the current value of a certain variable in my module"? Something like

IntegerFieldValue field = Coral8Service.GetObject("ccl://localhost:6789/Default/SectorFlowAnalyzer", "sum(Shares)") as IntegerFieldValue;
int shares = field.Value;

In a standard C# application, this would be as simple as putting a Getter on a variable, and just calling the getter. If I was using Web Services, then I could call into a Web Service and just ask for the values of some variables or for some sort of object. But, from a C# app, how can I get the current value of a stream that is aggregating totals?

Another way of accumulating the total number of shares in a CEP engine is to step into the procedural world, and just define a variable. In Coral8, it would be something like this:

CREATE VARIABLE TotalShares INTEGER = 0;

ON TradeInputStream
SET TotalShares = TotalShares + TradeInputStream.shares;

Then, we would need a "pulse" to fire at 4:00PM every day, and upon this pulse firing, we could send the TotalShares to another stream.

I am sure that there are patterns in every CEP engine for accessing intermediate results, but something that is a no-brainer in a procedural language may not be so easy in a CEP vendor variant of SQL.



©2007 Marc Adler - All Rights Reserved

Friday, December 07, 2007

Coral8 and Transparency

I just tried to get some info on the Apama Event Processing solution (not their Algo Trading platform,just the simple ESP platform). I filled out a form, and now I have to wait for a Progress sales rep to call to arrange a demo. Even if I want to see an Apama webcast, I need to fill out a form.

Let's contrast this what Coral8 has to offer. Coral8 lets you download the entire developer platform, with all of the documentation included. Everything is included .... there are no important packages that are missing with the eval version. There is no 30-day license key that you have to get. There is no waiting for a salesperson to get in touch. As far as I know, you get everything is ready to go from the time you download the package.

I fail to understand why certain vendors make it so difficult to evaluate a package. In a big financial institution like the one I work for, if you use software in production and this software is not properly licensed and paid for, it is grounds for termination of your job.

Coral8 has the right attitude. Just get it into the hands of as many people as possible as spread the word around.

©2007 Marc Adler - All Rights Reserved

NEsper Docs

Good solid docs on the Java version. Unfortunately, the NEsper version references the Java docs. The NEsper version only comes with an auto-generated CHM file.

Looks like I will have to compile the examples and dig through the source code of the examples in order to see how to use NEsper. Thomas, it may make sense to outline the difference between Esper and NEsper in the master documentation ... maybe using highlighted text boxes to outline the differences.

It also may make sense to include the PDFs in the NEsper distrubution.


©2007 Marc Adler - All Rights Reserved

Per Se

One of the perks of working for Mega-Bank is that you get invited to sales and marketing functions that were previously out of reach to me when I was a consultant. Such was the case this past Wednesday, when I was invited to a marketing function by Autonomy at Per Se.

If you have never heard of Per Se, then maybe you have heard of The French Laundry, a Napa Valley eatery that is run by reknowned chef, Thomas Keller. Per Se is Keller's New York City version of the French Laundry, and is one of the most difficult reservations to get in New York.

Autonomy has quarterly executive briefings at Per Se, where they bring together the sales of management of Autonomy, various Autonomy business partners, current customers, and future prospects. In addition to a fantastic lunch, we got to see how Standard and Poors used Autonomy to help their analysts get through the millions of pages of regulatory filings. S&P has a team of PHD mathematicians that have have developed some fairly sophisticated models in Autonomy to help them extract the "meat" out of their stream of documents.

Autonomy seems to positioning themselves as a major add-on in the Sharepoint marketplace, adding very sophisticated document searching. It would be interested to compare Autonomy with things like Google Search and X1.

©2007 Marc Adler - All Rights Reserved

On to Esper/NEsper

I have had to expand the CEP evaluation process. I am going to start looking at NEsper, and maybe, Apama (after some recommendations by some of our Asia folks who seemed pleased at Apama's performance over heavy loads).

I just downloaded NEsper and I am starting to go over some of the docs. I am sure that Thomas and Aaron will correct me if I say anything incorrect about Esper. Two things stand out about the Esper offering:

1) No GUI Builder or visual tools, probably because .....

2) Esper/Nesper is a component designed to be incorporated into your application ... in other words, it is treated as a third-party .NET assembly, just like things like Syncfusion, Log4Net, etc.

So, unlike Coral8, where you run a separate Coral8 server process, you need to write an application that "contains" Esper/NEsper. While this solution does not favor quick, out-of-the-box prototyping as Coral8 does, it gives you more control over the CEP actions. Everything with Esper/Nesper is "in-process" to your application.

Also, Esper/Nesper is Open Source. I downloaded it, and I have the full source code sitting on my hard drive. I have to talk to the financial guys at my company, but I don't think that we would have to do the amount of financial due dilligence with an Open Source effort as we would with a company who does not follow the Open Source model. Maybe we will have to count the number of moths that fly out of Thomas' wallet.


©2007 Marc Adler - All Rights Reserved

Sunday, December 02, 2007

Reducing Lock Contention

Here is a good blog posting on 10 Ways to Reduce Lock Contention. Even though our .NET-based client-side framework behaves well, I should take these hints and examine our framework with a fine-tooth comb.

I am also following all of the recent developments in Parallel Programming coming out of Microsoft. I wonder how much Joe Duffy's team interacted with the Accelerator guys from Microsoft Labs. I am also very interested to see if our Derivatives Analytics team, which is very strong in .NET, can leverage this new technology instead of/in additon to some of the proprietary technology offered by hardware acceleration vendors.

By the way ... I just started using Google reader. This blog is one of the blogs that Google Reader automatically recommended.

©2007 Marc Adler - All Rights Reserved

Some Random Comments

1) Go out and see the new Coen Brothers' film, No Country for Old Men. Absolutely startling. I saw it over a week ago, and I still can't stop thinking about it.

2) Please pay careful attention to the Comments section of each post here. Many of the CEP vendors are responding with interesting and important comments.

3) I need to start thinking about a notification framework for the CEP project. Notifications are a bit more complicated in financial firms where Chinese Walls have to exist, and where compliance officers are constantly over your shoulder. It's a good idea to involve the compliance guys right from the start, and to have THEM tell you where the Chinese Walls should be. Nothing will get their attention more that discovering that your prop traders are getting notification about your customer order flow!

4) I just subscribed to Alex's blog. Some interesting posts. Takeaways from skimming through his blog include:

a) I need to narrow down CPU pricing from the CEP vendors. Let's assume quad-core machines.

b) I am more curious about NEsper than I was before.

c) How will Esper and BEA stay in sync? Seems a bit annoying that BEA has seen fit to change some of the syntactic sugar of the original product.


©2007 Marc Adler - All Rights Reserved

Friday, November 30, 2007

Consultant Wanted - C# and Market Data Expertise

A vendor who we do business with (not a CEP vendor!) asked me to help them find an independent consultant for a few months. This consultant should be a C#/.NET expert, know market data APIs, and probably (I am guessing) be decent at communications. This consultant will be working with developers from the vendor, all of whom know C# at a basic level.

I will help them identify this consultant. The resulting work will be consumed by my team, as well as other financial firms that rely on real-time market data.

You can contact me at

XXXXX magmasystems XXXXXXX
XXXXXXXX at XXXXXXXXXXXXXX
XXXXXXXXXX yahoo XXXXXXXXX

©2007 Marc Adler - All Rights Reserved

Coral8 Update

We are finishing up the first phase of the Coral8 evaluation. This week, I met with Terry Cunningham (who flew his Falcon 10 out to meet us), and I had a great session with Henry, their pre-sales engineer. Terry was the creator of Crystal Reports, and later, the head of Seagate Software. I always have a soft spot in my heart for a fellow pilot .... even if his plane can go faster and higher than mine!

We validated that Coral8 was putting out the same output as our custom app, and I was enlightened on some of Coral8's capabilities that were not so easy to find in their wads of documentation. Although there is much good in Coral8, there were also some gotchas.

- Documentation needs to be consolidated a bit. There are a lot of separate manuals plus technical articles. There needs to be a "cookbook" on their CCL language.

- You cannot test a simple user-defined function without writing an intermediate stream. There is no simple way to dump a variable to the console. In other words, I would like to do this simple thing:

CREATE VARIABLE commission;
SET commission = CalculateCommission(); -- this is my user-defined function
CONSOLE.WRITE(commission);

- We managed to get the Coral8 Studio to freeze consistently. Luckily, no work was lost. The Coral8 Studio is written using wxWidgets, so I wonder how they do unit-testing on the studio.

My opinion is that, although it is great to have the advanced features, you still need to pay attention on the everyday, little tasks that developers need to do. Henry tells me that, in the future, Coral8 will move to a more Visual Studio, file-based way of developing. I certainly welcome this. Henry spent 8 hours watching me drive. When I was having problems, I verbalized the issues so that Henry could see what I was going through and he could bring the issues back to his management.

On the plus side :

- I have been reading about Coral8's pattern matching capabilities. We will definitely be exploring this.

- Coral8 has a relatively inexpensive barrier to entry. If we have a production, development, and COB servers (all dual or quad-core machines), then it won't break our budget.

- Their software does have any time limits on the evaluation versions. One thing that I do not like is a license key that is only good for 30 days. Given the nature of financial companies, we often get pulled into a lot of side projects. I don't want my time to be in the "thick of things", only to find out that the license key elapsed. Coral8 is very friendly to the evaluator.


Now, on to Aleri. I will be using their new 2.4 release.


©2007 Marc Adler - All Rights Reserved

Financial Due Diligence

In my super-mega Investment Bank, we work with all kinds of vendors. In fact, in our old group, one of the things that we were charged with was investigating all kinds of esoteric technologies that could give us an edge in the trading world.

If you use a vendor for a "bet the farm"-type application, then you want to make sure that the vendor behind the product is rock solid. My boss, who is the Global Head of Equities Technology for the firm, asked me who the "800 lbs gorilla" is in the CEP space. He wanted to make sure that we were safe in our choice, and that no matter how good the technology is, we did not put all of our eggs into a guy working nights in his basement (although, those kinds of companies usually make the best software!).

There is really no 800-lbs gorilla is the "pure" CEP space. By "pure" CEP players, I am talking about guys like Aleri, Coral8, Streambase, Esper, Apama, Truviso, Kaskad, etc. In this space, most of these companies number their customers in the dozens rather than the thousands. These companies are all competing for that big reference customer, the one that companies can stand back and say "This investment bank doubled their trading revenues because of our product."

Compounding this fact is the whole credit crunch and subprime mess. The New York Times had an article yesterday that described the effects that the credit crunch is starting to have on all sorts of companies ... even softeware companies and web-design shops were mentioned. So, we need to make sure that the CEP vendor that we choose is not affected, nor will be affected by the credit crunch. Coincidentally, one ex-employee of a CEP vendor sent me private email that mentioned that his company was undergoing a round of layoffs.

No matter which CEP vendor you choose, you should always have one backup. This is standard practice when dealing with small vendors. You should have the vendor's source code in escrow. You should have your financial people do a deep dive on a vendor's financials. Is the vendor self-funded or are they VC funded? Does the VC have the appetite to wait 5 to 7 years for a good return on their investment? What is the past behavior of the VC firms with regards to startups? What happens if the chief architect of the product leaves the company? Is the product written in a mainstream language, in case you need to take possession of the source code that's in escrow?

These are all questions that you should ask before making the final selection of your vendor.



©2007 Marc Adler - All Rights Reserved

Saturday, November 24, 2007

First Use Case Done with Coral8

I now have Coral8 detecting when a sector has abnormal activity, and I have a Coral8 Output Stream publishing into a .NET application for visualization. If I want to, I can take the data from the Coral8 alert, transform it into a JMS message, and publish it out on the Tibco EMS bus for other applications in the organization to consume. Or, I can publish it out to another Coral8 stream.

Well done, Coral8 team!

Now, it's on to the Aleri evaluation. The good people at Aleri's sales engineering team have done most of this first use case, but now that I am armed with more Coral8 knowledge, I need to try to rebuild the Aleri use case from scratch by myself.

©2007 Marc Adler - All Rights Reserved

Thursday, November 22, 2007

More on the first CEP Use Case

Yesterday, I had a great two-hour session with Henry and Bob from Coral8 in which most of the use case was done.

Henry is our designated pre-sales engineer. His job is to do what it takes to make sure that the prospective customer is happy with the product before making a decision to purchase the product. Bob is the head architect of Coral8, and his job (as he described it) is to make sure that the product is as easy to use as possible.

Between Henry and Bob, two solutions were offered. I will go into the first solution in this blog entry. The second solution revolves around custom timestamping of messages by the input adapter, and this topic deserves a blog entry of its own.

The main problem was to analyze the order flow for each sector over a one minute timeslice, and determine if any sectors showed abnormal activity. The problem that I was faced with was that the concept of “time” was determined by the TransactTime field in the FIX message, and not by the “clock on the wall”. So, if for some reason, I received two FIX messages in a row, one whose TransactTime field was 14:24:57 and one whose TransactTime field was 14:25:01, then the receipt of the second FIX message should cause a new timeslice, regardless of what the wall clock said.

The solution that Henry came up with was to use a pulse in a stream. Although the concept of raising an event is very common is programming, it is not really something that you tend to do in SQL stored procedure. The thing is that programming in Coral8’s CCL (as well as the SQL-like dialects that many of the CEP vendors have) is a combination of procedural and SQL programming, and the trick is to find the correct “pattern” to solve your problem. This is where many of the CEP vendors can improve; they can publish a listing of patterns, they can come up with FAQs, etc. I mentioned this to Bob of Coral8, so expect to see some movement on this front from the Coral8 folks.

Here is what the pulse stream looks like in Coral8’s CCL:

----------------------------------------------------------------------------------
-- LastTimeSlice holds the maximum timeslice (0 to 389) of the order stream.
-- When we see an order with a TransactTime greater than the current max timeslice,
-- then we set the new max timeslice. We also use this as a signal (pulse)
-- to one of the streams below.
----------------------------------------------------------------------------------
CREATE VARIABLE INTEGER LastTimeslice = -1;
CREATE LOCAL STREAM stream_Pulse;

INSERT INTO stream_Pulse
SELECT
TimeToTimeBucket(FlattenNewOrder.TransactTime) AS epoch
FROM
FlattenNewOrder
WHERE
TimeToTimeBucket(FlattenNewOrder.TransactTime) > LastTimeSlice;

-- When we insert a new timeslice into the stream_Pulse stream, we also
-- set the new maxmimum timeslice.
ON stream_Pulse
SET LastTimeSlice = stream_Pulse.epoch;

We have a global variable that keep the maximum timeslice that is flowing through our system. Since there are 6.5 hours in the trading day, there are 390 minute-sized timeslices that we want to consider.

In the INSERT statement, if the timeslice from the incoming FIX message is greater than the current maximum timeslice, then we insert a new record into the pulse stream.

The ON statement functions like a trigger. When a new record is inserted into a stream, you can have one or more ON statements that react to the event of inserting a record into the stream. Here, we set the new maximum timeslice.

We need to maintain a Window that contains all of the orders for the current timeslice. The order information includes the stock ticker, the sector that the stock belongs to, the number of shares in the order, and the current timeslice. In Coral8, a Window provides retention of records. You can specify a retention policy on a Window, whether it been a time-based retention policy (keep records in the window for 5 minutes) or a row-based retention policy (keep only the last 100 rows). What is missing here is a retention policy based on a boolean expression or on a certain column value changing. Streambase has this, and Coral8 knows that this feature should be implemented down the road.


----------------------------------------------------------------------------------
-- The TickerAndSector window holds all FIX orders for the current timeslice.
-- Each row of the window contains the FIX order and the sector information.
-- When we see a new timeslice, the TickerAndSelector window is cleared
-- using a DELETE statement.
----------------------------------------------------------------------------------
CREATE WINDOW TickerAndSector
SCHEMA (Ticker STRING, SectorName STRING, SectorId INTEGER, Shares INTEGER, TransactTimeBucket INTEGER)
KEEP ALL;

INSERT INTO TickerAndSector
SELECT
FlattenNewOrder.Ticker,
TickerToSectorMap.SectorName,
TickerToSectorMap.SectorId,
TO_INTEGER(FlattenNewOrder.Qty),
TimeToTimeBucket(FlattenNewOrder.TransactTime)
FROM
FlattenNewOrder,
TickerToSectorMap
WHERE
TickerToSectorMap.Ticker = FlattenNewOrder.Ticker
AND TimeToTimeBucket(FlattenNewOrder.TransactTime) >= LastTimeSlice;


Now that we have a list of orders that occur for the current timeslice, we need to know when a new timeslice occurs. At this point, we need to analyze the orders for the current timeslice, find out which sectors are showing abnormal activity, and clear out the TickerAndSector window so that new orders can be accumulated for the new timeslice.

----------------------------------------------------------------------------------
-- The OrdersPerSectorPerMinute window contains the aggregated totals
-- for each sector for the previous timeslice. The aggregated totals include
-- the number of orders for each sector and the total number of shares for each sector.
--
-- The interesting part of this is the join between the TickerAndSector window
-- and the stream_Pulse. The stream_Pulse will be triggered when we see a new
-- timeslice.
--
-- When we insert rows into the OrdersPerSectorPerMinute window, we will trigger
-- a deletion of the old info in the TickerAndSector window.
----------------------------------------------------------------------------------
CREATE WINDOW OrdersPerSectorPerMinute
SCHEMA (SectorName STRING, SectorId INTEGER, OrderCount INTEGER, TotalShares INTEGER, Timeslice INTEGER)
KEEP 2 MINUTES;

INSERT INTO OrdersPerSectorPerMinute
SELECT
tas.SectorName, tas.SectorId, COUNT(*), SUM(tas.Shares), stream_Pulse.epoch
FROM
TickerAndSector tas, stream_Pulse
GROUP BY
tas.SectorId;

ON OrdersPerSectorPerMinute
DELETE FROM TickerAndSector
WHERE TransactTimeBucket < LastTimeSlice;

As you can see from the above code, when a new timeslice appears, we aggregate the number of orders and the total number of shares that are in the TickerAndSector window. The interesting thing here, and the thing that I might not have figured out on my own, was that we need to join with the pulse stream that we talked about before. The pulse stream here is being used to “kick start” the calculating and dumping of the records in the current timeslice.

Finally, since we have aggregated the information for each sector for the current timeslice, we want to see if any sector exceeded the maximum “normal” number of orders.

----------------------------------------------------------------------------------
-- This output stream will alert the user when a sector exceeds the
-- max orders for that timeslice.
----------------------------------------------------------------------------------
INSERT INTO AlertStream
SELECT
R.SectorId, R.SectorName, R.OrderCount, R.TotalShares
FROM
OrdersPerSectorPerMinute AS R, NormalOrdersPerSectorPerTimeslice AS H
WHERE
R.SectorId = H.SectorId AND R.Timeslice = H.Timeslice AND R.OrderCount > H.MaxOrders;

And, that’s it! If we attach a JMS output adapter to the AlertStream, we can generate a new, derived event, put that event back on the EMS bus (or we can send it into another Coral8 stream), and alert some kind of monitoring application.

Thanks to the Coral8 guys for helping me slog my way through the learning process.

©2007 Marc Adler - All Rights Reserved

Tuesday, November 20, 2007

Our First CEP Use Case (and thoughts on Coral8 and Aleri)

For the Complex Event Processing (CEP) engine evaluation, we have chosen a very simple use case. This use case is:

Tell us when orders for a sector show a greater-than-normal level.

Even though this use case seems very simplistic, and would not tend to be an ideal use case to test a CEP engine, it is an ideal use case for our environment. Why? It forces us to get at various data streams that have previously been inaccessible to most people, and it forces the owners of these streams of data to make there data clean.

(Note: this use case is a very generic use case and test for CEP. I am not giving away any special use cases that would give my company a competitve edge, not will I ever do so in this blog.)

At the Gartner CEP Summit last September, Mary Knox of Gartner mentioned that one of the obstacles for doing successful CEP projects at large organization was the process of liberating all of the data sources that you need, and getting the various silos to talk to each other. We have found this to be the case at our organization too. We figure that if we can get this simple use case to work, then we have won 50% of the battle.

What kind of data do we need to implement this use case?




  • We need to tap into the real-time order flow. Order flow comes to us through FIX messages, and for older systems, through proprietary messages that will one day be deprecated. Luckily, we have found a system that provides us this information. Although this system is a monitoring GUI, we have identified its importance to our company, and we are working with the product owner to split his app into a subscribable order service and a thinner GUI.
  • We need historical order data in order to determine what “normal activity” is for a sector. Luckily, we have this data, and we are in the process of getting access to it. We also need to understand what we mean by “abnormal activity”? Does this mean “2 standard deviations above the 30-day moving average for a sector”?
  • We need to be able to get a list of sectors, and for each order, we need to map each ticker symbol to its sector. Sectors are signified by something called GIC codes, and there are 4 levels of GIC’s. The important thing that we need is to ensure that all corporate actions get percolated down to these mapping tables. So, if a company changes it ticker symbol (like SUNW to JAVA), then the new ticker symbol needs to be automatically added to these mapping tables.


  • Let’s say that we are able to get all of the data that we need, and that the stream of data is pristine. We have to get it into the CEP engine for analysis.

    If you think if writing a normal, procedural program (i.e.: a C# app) to do this analysis, the steps are pretty easy.

    1) Read in all of the reference data. This includes the ticker-to-sector mappings and the list of normal activity per sector per time-slice. We will consider a timeslice to be a one-minute interval. In a 6.5 hour trading day, there are 390 minutes. There are also 11 “GIC0” sectors. So, a timeslice will be an integer from 0 to 389.

    2) Subscribe to a stream of FIX orders.

    3) As each order comes in, extract the ticker and map it to a sector. We are also interested in the number of shares in the order and the time that the order was placed. For each order, increment a running total for that sector and for that timeslice.

    4) Any orders that come in that are past the current timeslice are ignored. Also, any orders that come outside of the normal trading day are ignored. This way, we don’t consider any orders that may have been delayed through our systems.

    5) If we detect a new and later timeslice, then examine all of the sectors for the previous timeslice. If any of the sectors show heightened activity, then alert the user. Then, clear the totals for all of the sectors, and start accumulating new totals for all of the sectors.

    This looks pretty easy. I would assign this to a good C# developer, and hope to get a finished program in one or two days.

    Now, the task is to map this into a CEP engine.

    Most of the CEP engines have a language that is based on SQL. So, you can imagine all of the processing steps above passing through multiple streams in the CEP engine. For step 1) above, we would have two input streams, one for the ticker-to-sector mapping data and the other for the “normal sector activity” data. You can imagine two simple SELECT statements in SQL that read this data from some external database, and construct two in-memory tables in the CEP engine.

    For step 2, you need to write a specialized input adapter that subscribes to a communications channel (sockets or JMS) and reads and decodes the FIX orders. Most orders come through as NewOrderSingle messages (FIX message type = ‘D’). There are various versions of FIX, but let’s say that everything comes in as FIX 4.2 messages.

    Most of the CEP vendors support in-process and out-of-process adapters. In-process adapters are faster than out-of-process adapters, but out-of-process adapters are usually easier to write. An out-of-process adapter will read data from some kind of communications bus (or even from a database table or a flat file), and will write a data stream to the CEP engine. It would be ideal to have the CEP vendors support FIX in in-process input and output adapters.

    Step 4) is easy. We calculate the 0-based timeslice for an order, and if it is below 0 or above 389, then we ignore this order in the stream. This can be done with a simple WHERE clause in the SQL statement.

    We also need to record the “current timeslice” and ignore any orders that come before the current timeslice. So, we need the concept of a “global variable” and when we see an order with a later timeslice, we need to update this variable. This is something which is easy to do with a procedural language, but what is the best way to do this in SQL?

    Steps 3) and 5) are interesting. We need to keep a one minute window per sector. This window should only keep running totals for the current timeslice. When a new timeslice comes in, we need to analyze the sector activity in the current timeslice, do any alerts, and then clear out the totals in all sectors. Again, this is something that is extremely easy to do in a C# application, but translating it into SQL is a bit of a challenge.

    In step 3), the mapping of ticker to sector is very easy. It’s just a join of the ticker in the order with the ticker in the mapping table. The interesting thing is the choice of window type for the stream. Do we accumulate all orders for all sectors for the one-minute timeslice, and then, when we see a new timeslice, do we just take a COUNT() of the number of orders for each sector? Or, do we simple have a window with one row per sector, and keep running totals for each sector as an order comes in?

    Coral8 supports the concepts of sliding and jumping windows. Aleri supports only sliding windows right now. With Coral8, we can set a window that will hold one minute’s worth of data, and we can also tell a stream that it should dump its output after one minute. However, we don’t want to tie the TransactTime in a FIX order message to the actual clock on the computer. We need a stream that will produce output on a certain value in a column, and neither Coral8 nor Aleri seem to have this yet.

    Here is some Coral8 code that shows windows and streams:

    CREATE WINDOW TickerAndSector
    SCHEMA (Ticker STRING, Sector STRING, SectorId INTEGER, Shares INTEGER,
    TransactTimeBucket INTEGER)
    KEEP EVERY 60 SECONDS;

    INSERT INTO TickerAndSector
    SELECT
    FlattenNewOrder.Ticker,
    TickerToSectorMap.SectorName,
    TickerToSectorMap.SectorId,
    TO_INTEGER(FlattenNewOrder.Qty),
    TimeToTimeBucket(FlattenNewOrder.TransactTime, 'HH:MI:SS AM')
    FROM
    FlattenNewOrder,
    TickerToSectorMap
    WHERE
    TickerToSectorMap.Ticker = FlattenNewOrder.Ticker
    OUTPUT EVERY 60 SECONDS;

    The first statement defines a window that keeps one minute’s worth of order data. After one minute, the window will empty its contents.

    The second statement will insert a new row into the window whenever we get a new order. After one minute, the window will send its output to another stream further down the pipeline. (We hope that the data will be sent to the next stream before the window clears itself. Otherwise, we will lose all of the data.)

    So far, in my brief evaluation, I have found step 5) difficult to implement in Coral8. Aleri has implemented this by using a FlexStream. A FlexStream is a stream that has procedural logic attached to it. Aleri has a custom C-like programming language that you can use to implement procedural logic in a FlexStream. But, if you write too much logic using FlexStreams, then wouldn’t you be better off to just write a nice C# application?

    To validate some of the CEP engines, I ended up taking a day and writing a C# application that implements this use-case. For grins, I added a tab that showed some animated graphics using the very excellent ChartFX package. The head of the trading business was so excited by this eye candy that he started to bring over various traders for a look at my simple app. So, in addition to this little app giving the traders information that they did not have before, it provided them a flashy way to see real-time movement across sectors.

    In addition to having SQL skills, a good CEP developer needs to readjust their way of thinking in order to consider pipelined streams of SQL processing. There is a big debate going on in the Yahoo CEP forum as to whether SQL is a suitable language for CEP processing. So far, with this use case, I see the suitability of SQL, but I also need to step out of the SQL way of thinking and apply some procedural logic.

    One of the things that I still need to be convinced of is that CEP engines can do a better job than custom code. I am all ears. Any CEP vendor (even Streambase) is invited to submit public comments to this blog to tell me how this use case can be implemented with their system.


    ©2007 Marc Adler - All Rights Reserved

    Saturday, November 17, 2007

    CEP Vendor Thoughts

    Recently, I came across an article on Streambase in Windows in Financial Services magazine. One of the questions to the head of Streambase went like this:

    WFS: Does StreamBase have any competitors?

    BM: The major players have not yet delivered anything in this space. IBM, for example, does not have a project to build a technology like this. We are IBM’s solution in this space.

    In my opinion, this answer totally evades the question. What happened to companies like Aleri, Coral8, Esper, Apama, Skyler, Truviso, Kaskad, etc? How about the IBM offering that Opher is working on? Alll of these companies freely acknowledge Streambase as a worthy competitor, and rightly so. It would be nice to see Streambase acknowledge the same. Brown University certainly was not the only university doing CEP research and not the only one to commercialize their offerings.

    And shame on Microsoft and Windows in Financial Services magazine for letting this slip by. Are you a journalistic effort or a fluff rag?

    In our evaluation of CEP vendors, we chose not to evaluate Streambase for various reasons. Streambase might have the best technology of all of the CEP vendors (for example, look at Tibbets comment from a few weeks ago on a question about cancelling events), but we will never get to find out. The people who I feel badly for at Streambase are the dedicated development and support staff who have probably come up with a really good product.

    (In the interest of fairness, Bill from Streambase told me recently that they had reduced the price of their offering, which was one of our concerns.)

    And, if anybody from Streambase reads this blog ---- doing an end-run around me and trying to market directly to the business will not earn you any points. The business people rely on me to make the right decision, and all of your email to the business side (as is any email from information technology vendors to the business side) gets forwarded directly to me. And, I guess that we will end up paying real dollars to your imaginary competitors.

    Meanwhile, let's take the attitudes of Coral8 and Aleri. One of these companies JUST hired its first salesperson. Their mantra was that the product should be the best that it can be before it was pushed by a salesforce. The other company has a low-key sales approach too. They have gone beyond the call of duty to incorporate our suggestions into their product and to come up with a POC that really impresses us.

    Both vendors have come up with FIX input adapters at our behest. Aleri has incorporated some of our suggestions into their FlexStreams, and has cleaned up some of their visual development studio. (With FlexStreams, you can use a procedural programming language to create custom processing for streams). I am impressed in what these companies have done to earn our business. I feel that, in exchange for these companies doing some of what we want, they get to expand their offerings for the capital markets communities, and bring themselves out of the narrow focus of algorithmic trading and pricing engines.

    Kudos to Mark, John, Henry and Gary of Coral8, and to Don, John, Jerry, Jon, David, etc of Aleri. All very nice people, and all trying compete honestly for a piece of the pie.

    In my opinion, the Coral8 and Aleri offerings are so close that we will eventually be choosing one vendor as primary and the other as hot backup. What needs to be done is performance evaluation. Pushing multiple streams of fast moving data into the CEP engine and seeing their performance under heavy load. Let's see if they can handle the data rates that come at 2:15 PM on a Fed decision day.

    One message that we have been hearing from the CEP and messaging vendors is that they perform better under Linux than Windows Server 2003. This is probably not a surprise to most people on Wall Street. But, I wonder what Windows Server 2008 has to offer in comparison to Linux. The November 8, 2007 article at Enhyper has some interesting things to say about Microsoft's marketing of the London Stock Exchange deal. We will most likely be running our CEP engine on Linux unless Microsoft comes up with a real compelling reason to the contrary.


    ©2007 Marc Adler - All Rights Reserved

    Wednesday, November 07, 2007

    IBM's ManyEyes

    (Thanks to Jules)

    ManyEyes is a community-based visualization project from IBM, run by the guy who did the Stock Market heatmaps for Smart Money.

    You can upload your own datasets and apply some pre-made visualizations to it. People in the community have contributed other visualizations.

    Pretty cool.

    ©2007 Marc Adler - All Rights Reserved

    Algorithm for Implementing Treemaps

    http://www.win.tue.nl/~vanwijk/stm.pdf

    ©2007 Marc Adler - All Rights Reserved

    Sunday, November 04, 2007

    Help Wanted for the Complex Event Processing Project

    I have open headcount for about 4 or 5 people for 2008 for the Complex Event Processing project that I am running.

    I realize that it is foolhardy to advertise for people who have prior experience in CEP. What I am looking for are smart developers who have a great passion to learn a new, interesting technology. The team that I envision will consist of:

    1) Visualization developer - come up with new, interesting ways to visual events and data. The work may entail working with the .NET framework that my team has built, integrating visualizations with existing Java/Swing-based trader GUIs, or even exploring WPF (as the company gradually embraced .NET 3.x). You could be investigating visualization tools like heatmaps and you will definitely be evaluating third-party tools (both commercial and open-source). You will be involved in OLAP to some extent. There will be involvement in the building out of a notification and alerting framework.

    2) CEP developer. You will be building out the analysis part inside the CEP engine. Most of the CEP engines use a variant of SQL, so you should be fairly comfortable with SQL concepts. It would be nice if you had previous experience with tools like Coral8, Aleri, Streambase, Esper, etc, but even if you haven't, you should be willing to learn these tools. You may also be interacting with consultants from these companies.

    3) Networking, messaging, and market data specialist. Help us decide if we should migrate to a new messaging infrastructure (like RTI or 29West). Experience with Tibco EMS is a big plus, as well as experience with working with high volumes of data and low latency. Interact with Reuters and Wombat infrastructures, as well as internally-built market data infrastructures.

    4) Data specialist. You will be the person who is responsible for breaking down silos and getting good data into the CEP engine. Experience with SQL Server 2005 and Sybase are important. Experience with tick databases like KDB+ and Vhayu would be nice to have.

    Everyone will be doing a bit of everything, so everyone on this team will be intimately aware of what everyone else is doing.

    This is a highly-visible position in an investment bank that has promised me that they will reward good talent who comes to us from the outside.

    In addition to the positions mentioned above, I have two or three open headcount for people who want to work on the Ventana team. Ventana is the client-side .NET framework that is being used by various groups in our Investment Bank.

    ©2007 Marc Adler - All Rights Reserved

    Saturday, October 06, 2007

    The Consulting Market and More Thoughts

    Comments from various contacts in the consulting industry lead me to believe that there is a slowdown in financial IT consulting, with benches growing at various consulting companies around the globe. At the same time, there is a hiring freeze going on at many Wall Street companies, with exceptions being made only for outstanding candidates.

    A lot probably has to do with the subprime mess and the incredible losses that many Wall Street companies have announced. Bonus season is going to be very "challenging" this year.

    My company will be making a concerted effort to recruit outstanding IT people from outside. We realize that new blood is the way to shake things up, and transform our shop into one of the major IT houses on Wall Street. The business side has been taken over by people who have CompSci degrees from top universities, and this new regime realizes that tech will drive future profitability.

    Despite this, I have open headcount for 2008 for the Complex Event Processing initiative. When I get back from my week in France, I will post a general call for help. If you have a driving interest in CEP, and you can code in C#, Java, and C++, and you know how to deal with Linux and Windows, then I want to speak to you. I think that CEP will provide a fundamental change in the way we trade and the way that apps are written and the way that data is visualized.


    ©2007 Marc Adler - All Rights Reserved

    Saturday, September 29, 2007

    Cancelling Events

    http://blogs.streamsql.org/streamsql/2006/08/handling_revisi.html

    Mitch Cherniak poses a question that I posed a few weeks ago about "compensating events".

    Mitch seems to be involved in that same project that produced Streambase. I am not sure if Cherniak is involved with Streambase in any way, but it would be interesting in the Streambase folks have thought about this same topic.

    ©2007 Marc Adler - All Rights Reserved

    Wednesday, September 26, 2007

    A New Quant Blog

    http://4quants.blogspot.com/

    ©2007 Marc Adler - All Rights Reserved

    Tuesday, September 25, 2007

    OneTick

    Yet another tick database, to compete with KDB+ and Vhayu. Plus, they just inked a deal with Wombat.

    Looks like more mad Russian scietists that escaped from Goldman.

    ©2007 Marc Adler - All Rights Reserved

    Francis and Karen

    My colleague Francis and his young wife are involved now in the battle of a lifetime. It makes the daily bullcrap that we put up with at work seem very trivial, and makes decisions like "should we use DDS or JMS" seem inconsequential.

    My prayers and thoughts are with them daily.

    Francis has written a WROX book that is available from Amazon.


    ©2007 Marc Adler - All Rights Reserved

    DDS vs JMS

    Data Distribution Service (DDS) is an alternative to JMS. This spec was designed and is supported by OMG (Object Management Group). The concepts are fairly familiar to anyone who has done JMS.

    RTI implements DDS in their message bus.

    My feeling is that getting a large enterprise to use DDS is akin to rewiring a battleship. However, it seems like DDS has some possible performance improvements over JMS.

    Anybody out there using DDS?


    ©2007 Marc Adler - All Rights Reserved

    Saturday, September 22, 2007

    A New Financial IT Blog

    Tom Steinthal's blog is here

    ©2007 Marc Adler - All Rights Reserved

    Nancy

    I will away the week of October 7th. I will be travelling to Paris and then to Nancy (France) for the annual Nancy Jazz Pulsations festival. The purpose of my trip is to see a 2-night concert by my favorite band, Magma. The famous French bassist, Jannick Top, will be performing with Magma, and for me, this recreation of their famous 1974 line-up is reason enough for me to dip into my AMEX points....

    ©2007 Marc Adler - All Rights Reserved

    Coral8 vs Streambase

    http://www.dbms2.com/2007/08/10/coral8-versus-streambase/

    Interesting reply by Bill of Streambase .....

    However, I think that the only way that this will be solved publically is by STAC and their independent benchmarks.



    ©2007 Marc Adler - All Rights Reserved

    CEP Conference Report

    I thought that the CEP conference would be a sleepy little symposium, but I was wrong.

    Gartner ran their conference on Business Process Monitoring on the Monday-Wednesday morning, and it dovetailed exactly into the CEP conference. There was also an academic conference on CEP that ran concurrently with the BPM conference, so you had a lot of academics and curiosity-seekers at the CEP conference.

    I would estimate that there were about 200 attendees at the CEP conference, but probably half were from the vendor community. I counted about 50-60 attendees in the financial services track at the conference, and again, about 40-50% were vendors. So, there were probably about 30 folks from the financial services industry who were really curious about CEP.

    I give these numbers to illustrate that, in financial services, CEP is still in the curiousity stage. I am happy to say that most of the people there were just as confused as we were (ie: what is the difference between a CEP engine and a rules engine, what is the best messaging middleware to use, do we really need a visual designer, etc). Most of the people who were using CEP were using it in a simple stream case ... pricing, algos, fraud detection, etc. I did not see any use cases that approach the magnitude of what we have to do, but then again, I don't expect organizations like Goldman Sachs to advertise what they are doing.

    It was nice to see some of the vendors trotting out their successes in financial services (Aleri with HSBC, CommerzBank and Barcap, Streambase with BofA, Coral8 with Wombat), and start to establish some meaningful partnerships. Nice to see that Coral8 is working closely with RTI.

    Mary Knox of Gartner did a nice presentation on what it takes to get CEP adopted by a large financial organization, but she compensated for this nice presentation by monopolizing the Q&A session with Robert Almgren of BofA. I was a bit puzzled by IBM's message about what parts of their CEP framework were already available in Message Broker, who was supporting it in IBM, who we get services from, etc.

    I was impressed with Mark from Coral8, who seems to bring that Russian mad scientist mentality to his company. Also encouraging to see that Terry Cunningham is at the helm at Coral8, fresh from his successes at Crystal and other companies. Terry knows what it takes to make a successful software company. They also seem to be on the top of their game with financial services, without restricting themselves solely to algo trading.

    Aleri seems like they have some raw power in their platform, and over time, they will be polishing their message more. They win the award for the most genial vendors of the conference.

    The key takeaways were:

    1) The CEP industry is still at its infancy.
    2) It's a fairly hot buzzword right now.
    3) The complete stack is important if you do large deployments. We need to understand all of the pieces surrounding the CEP engine.
    4) Message volumes are increasing at an exponential rate in financial services.
    5) It will be a long battle to break all of the silos in our company.


    ©2007 Marc Adler - All Rights Reserved

    Tuesday, September 18, 2007

    CEP Vendors, DBMS's and Defense Industry

    I made a comment in my last posting about RTI, a small messaging and CEP vendor. It seems that RTI got its start in the defense industry. Coincidentally, IBM is allowed to mention the fact that its System S arose out of a 4-year defense contract.

    CEP vendors who grew out of the DBMS sector might have certain advantages, but ones who grew out of defense have other advantages. First, you would expect that anything that had to pass Military testing and certification would be industrial strength. These systems would have to be able to handle a huge throughput of signals and would have to be able to react correctly to the input .. after all, you don't want our ships firing a missle at a seagull. Second, the analysis tools have to be top-rate ... detecting a signal and firing a missle is much like pulling the trigger on a trade. Both have enormous consequences, and once out there, cannot be retracted.

    I am not completely positive, but I can imagine that messaging systems in the defense industry might not have to worry about guaranteed delivery. It seems to be OK to drop a few signals (events messages) that the radars send out, and eventually (a few milli-seconds later), the signals would resume.


    ©2007 Marc Adler - All Rights Reserved

    Thoughts about CEP Patterns

    One of the things that I have been wondering about:

    How do you do transactions in the context of event processing? For example, if I get an event, we might trigger some units-of-work and generate some more derived events from this initial event. These derived events might be put into the event cloud.

    If one of the units-of-work fail, how do we rollback the "transaction"? Do we need to define compensating events? Do we need to suck the derived events out of the event cloud? Do we need to attach "state" to the derived events which signal whether they are part of a transaction?

    We run into a lot of the same issues here that DBMS vendors have run into. How can the transactions patterns in the DBMS world be applied to CEP?

    Another thing I have been interested in is the generation of recursive events. If I get an event and generate a derived event, how do I know that this derived event will not result in recursion? Again, DBMS vendors have run into the same situation with database triggers, and some lessons can be learned.

    So, does this mean that we are better off considering a CEP vendor who has roots in the DBMS world?

    (As you can see, I am just using the blog as scatchpad for some thoughts .... but it gives you an idea about the things that any of you who are implementing CEP might have to consider...)


    ©2007 Marc Adler - All Rights Reserved

    HPC Conference Thoughts

    Yesterday's HPC On Wall Street conference could be summed up in one word .... PACKED! I thought that this would be a sleepy little conference, with a few crazy architects from a few IBs and hedge funds walking around. When I got there, I could not even move through the (very narrow) aisles that the vendors were set up in. I would guess that there must have been 700-800 people at this conference, and it is at these times that I am thankful that I am not a lightweight, as I merrily tossed my compatriots all over the Roosevelt Hotel in my quest to get to the conference rooms.

    The two panels that I went to were, unfortunately, complete wastes of time. Even some of the panelists that I spoke to afterwards were half-embarassed to be on the folically-challenged panels. (I am still wondering what Gideon Low from Gemstone was doing up there in the session on Multicores and Market Data .. although he DID manage to come up with better answers than the Chief Architect of Fidelity!). It only reinforces my opinion that if you are doing something unique and important, your company will never let you speak about it on a panel!

    And, thanks to the people from Bear Stearns, who during our lunch with a vendor, planted themselves at our lunch table and managed to kill our conversations.

    I was heartened to see a constant flow of traffic at the Digipede booth. In several square meters, you could talk to Microsoft (CCS), Digipede, and Platform (who were displaying at the IBM booth). I was disappointed to see one CEP vendor there (Aleri).

    The most interesting new player was STAC, who purports to be an "independent" kind of lab, where both vendors and customers can go to in order to get evaluations and benchmarking done .... sort of like a Consumer Reports magazine. One interesting comment from them was that, in their early experience, some of the claims about feature sets that various vendors make do not actually hold up when it came time to implement the vendors' products. An independent lab for the securities industry is long overdue, and it is heartening to see vendors contribute hardware to STAC in order to "bootstrap" their operations. The two main guys from STAC are ex-Reuters guys, and so you know that they have good experience in market data systems.

    There were some real small players (like RTI in the messaging space) who might be ripe for joint ventures or investment. Seeing these guys work the floor reminded me of my days as a software vendors going exhibiting at shows ... an absolutely exhausting experience.

    My colleagues have told me that the HPC show has grown exponentially over the past four years .... if I grows any more, then the Roosevelt Hotel is going to have to abandon the cattle car approach, or else, I am going to have to put on a few more pounds!


    ©2007 Marc Adler - All Rights Reserved

    Saturday, September 15, 2007

    Another New Position (again)

    Last week, I was about to finalize my transfer to the Derivatives Analytics desk when an amazing opportunity was offered to me by my company. I cannot blog too much about this new opportunity other to say that it involves Complex Event Processing and transformational new directions for trading and decision making in Equities. This is a huge initiative for my company, is being sponsored by the top people on the business side in Equities, and goes all the way up to the CEO of the company. I will be leading this new project on the technical end, and I am working with one of the movers-and-shakers on the business end.

    This is not the standard algorithmic trading scenario that is the standard use case for vendors like Apama, Skyler, etc. We will be pushing the limits of the CEP and messaging vendors. We have the mandate to have all of our Equities systems interact with our. And, if everything goes right, it will transform the way that systems are written within our company.

    The nice thing is that the Business is giving us several months of pure R&D time. Reading papers, attending conferences, meeting vendors, etc. For me, it is coming out of a silo and being given the opportunity to learn about every phase of our systems for trading equities. And, it will be building upon all of the things that I have been investigating for the past year in my Architecture role.


    ©2007 Marc Adler - All Rights Reserved

    CEP and HPC Conferences

    I will be stopping by the High Performance Computing on Wall Street conference on Monday, Sept 17, and catch up with the new Digipede release.

    Wednesday through Friday, I will be at the Gartner Complex Event Processing conference in Orlando.

    I am starting to feel like a vendor. However, in my new role, I am basically playing software entrepreneur again, this time in the context of a multi-billion company.


    ©2007 Marc Adler - All Rights Reserved

    Thursday, September 06, 2007

    .NET Winforms Expert Wanted

    We would like to hire a true .NET/Winforms/C# expert (must be Winforms, not ASP.NET). A substantial part of the job would be to take over the .NET Client-side framework that Equities is using (ie: the thing I developed). You must be proficient in real-time front-ends, multithreading, understanding of messaging systems like Tibco EMS, etc.

    You would be sitting in beautiful Warren, New Jersey, which is about 45 minutes west of New York City. However, you would have substantial opportunities to work with the business, which is located both in New York City and in Jersey City, NJ.

    We would strongly prefer a full-time employee, although we might make an exception for an indie consultant.

    This is an on-site job. So, please don't send me resumes from the Ukraine, asking if you can work remotely. Also, no calls from recruiters and consulting companies for now. I want to pick from people who are truly interested in financial services and .NET ... and these people probably read this blog already.

    Since the position is in the Equities Advanced Architecture group, you must be a really strong communicator. If I ask you to get up to a whiteboard and explain something, I should be able to understand you without straining.


    ©2007 Marc Adler - All Rights Reserved

    Friday, August 31, 2007

    IBM and Limitless "Vacations"

    Catch this while the NY Times still has it for free:

    http://www.nytimes.com/2007/08/31/nyregion/31vacation.html

    Reminds me a little bit of myself ....

    ©2007 Marc Adler - All Rights Reserved

    Bonus Paralysis

    I have heard of a number of financial companies who are having a very difficult time hiring .NET developers, especially ones with WPF skills. The main problem with getting financial developers to move companies at this time of the year is Bonus Paralysis. Bonuses are typically announced in December and paid out in January, and nobody is going to sacrifice their bonuses at this time of the year to change companies .... unless ......

    ... there were little or no bonuses paid out. Because of the credit crisis, a number of news organizations have stated that bonuses this year will be drastically reduced. Everyone is now suitably warned and prepped to receive a significant decrease in last year's bonus (especially if you are in structured finance and credit derivs). And, at this time of the year, a new company would probably not guarantee your bonus.

    If you are not expecting much of a bonus, would you stay around?

    ©2007 Marc Adler - All Rights Reserved

    CEP Conference

    There is a good chance that I will be at the first Gartner Summit on Complex Event Processing in Orlando, September 19-21.

    I am especially interesting to see what Coral8 has to say. My interests are in using CEP for Business Activity Monitoring and Algorithmic Trading.

    Matt and Chris have had some good things to say about Coral8 in the past, and if I had some time to breathe, I would like to download their SDK and start mucking around.


    ©2007 Marc Adler - All Rights Reserved

    Wednesday, August 29, 2007

    Working on the Trading Floor

    A few weeks ago, Terry left a comment, asking what it was like to work on the trading floor.

    I sit on a very large Equities trading floor that overlooks the Hudson River in lower Manhattan. Our particular area of the floor has the Derivatives Analytics group (my group) and Algorithmic Trading. The next row has the High Frequency Trading guys and some of the guys who control the high-speed market data systems.

    Needless to say, the past few weks have been crazy. There is such an energy on the floor that, sometimes, everyone is our row just stops working in order to absorb the electricity. 15 minutes before the opening, things start humming. At the bell, it's chaos for about a half hour. People screaming out orders, groups of traders applauding and whooping when a trade turns out favorable. After 10, things really slow down until about 3PM.

    Our group is composed of Quants. We trade our own positions, and we write software which enable us and other groups to trade. Almost all of our software is in C#/.NET 2.0, heavy use of generics and anonymous delegates.

    The group is ethnically diverse. 4 Americans, 1 Brit, 3 Far-East Asians, and a couple of Russians for good measure (what's a good Quant group without the Russians!). 3 of the guys have PHDs, the rest have MS's. Actually, the head of the group does not have a Master's degree ... however, he got 3 Bachelor's degrees in 3 years at one of the top business schools in the world. Most of the group is fairly young. If you are in your early 30's, you are ancient. That makes me a pile of ash on the floor.

    The group has its own framework. The framework is typical Russian mad scientist code. With this kind of code, it's never "A calls B". It's "A starts 5 threads, waits for completion signals, creates other objects via some dependency injection, does a few somersaults, and then calls B." But the framework is highly performant.

    One of the things I am doing is writing some risk hedging apps using my own framework that my team developed for Equities. So, I am eating my own dogfood. I have not found any bugs in my stuff, but I have had to extend it a bit so that it cooperates with some of the stuff that Derivs Analytics have previously written (like Live Greek Servers).

    As exciting as the trading floor is, I welcome the one or two days a week that I work from home. If I have to do really major thinking and design work, I cannot do it at work! It is hard to work at work. Luckily, a lot of Wall Street is starting to go to a model of allowing people to work from home part time. The three hours I save on commuting to NYC is time that I put into work. Now that my son is off at college, I don't have to worry about his heavy-metal bands coming into the house at 3:00 every afternoon to thrash around the basement.


    ©2007 Marc Adler - All Rights Reserved

    Random Musings

    Yes, I know that I have not been blogging very actively this summer, but at the insistence of some colleagues and vendors who demand continuous entertainment, I will try to embark on another series of stream-of-conciousness postings.

    Let's see what's new ....

    1) London again. More groups coming aboard with my .NET client framework, so I was asked to pay another visit to London during the week of July 16. That's 3 times in London in less than a year. I don't mind going to London ... the first-class service aboard Virgin Atlantic is stellar, and this time, I was treated to massages on both legs of the trip.

    What was exciting about this trip is that the department that I was meeting with are going to be taking four of their separate apps and combining them in a single consolidated front-end, with each particular group's app "running" as a separate DLL, registering services, and communicating with the other "apps" through my internal message bus. Still no separate app domains though.

    2) My son is in college now! Yeah! Spent the entire weekend cleaning the house of the carnage that he and his friends wrecked during the past few years.

    3) Going to be revisiting Complex Event Processing soon. Coral8 looks like a strong contender in the space. Why doesn't KX Systems realize that Q scares the mere mortal?

    4) I am taking a few members of the Derivatives Analytics team up in my plane tomorrow evening. A nice flight over the Catskill Mountains is planned. Usually when I ask people to fly with me, I get all sorts of excuses. However, the DA team is too young and too inquisitive to know what they're getting into! They will even help me pre-flight the plane. As long as they don't start asking me about auronautical mathematics, the flight will go well!


    ©2007 Marc Adler - All Rights Reserved

    Panopticon Rebuttal

    A few weeks ago, I made the comment that we have had some good success with the free Microsoft TreeMap control to implement heatmaps. I also mentioned the fact that, for our needs, the Microsoft product seemed to suffice and that I did not see any immediate reason to buy the Panopticon product for heatmaps.

    The Panopticon people asked me for some time on my blog to address the difference between the Treemap and their product, so I have reprinted their comments verbatim:

    “What we at Panopticon Software offer in the product called Panopticon Developer is an SDK for embedding visual analysis and monitoring functionality into applications by means of integrating components such as interactive visualizations and a powerful data model capable of aggregating real-time data streams. The Microsoft Treemap control seems in to be considerably smaller and restricted in its API and designed to be used as a simple chart library and therefore for example does not include analytical functionality. Collateral posted at (public url at www.panopticon.com) provides more detailed information on how Panopticon Developer is compares in relation to more traditional chart libraries.

    With this SDK we’ve built a rapid web deployment toolkit called Panopticon Enterprise which provides very low ownership costs, extremely short time to market while preserving the functionality available in the SDK.

    We typically work out significantly cheaper than in-house build due to the lack of maintenance and ease of deployment for new requirements”

    (end of Panopticon comment .. now back to Marc)


    Like any company, we have a budget that is tightly controlled. If Panopticon, or any third-party product, provides fiunctionality that will cost us more to develop ourselves, then the decision is to go to a third-party product. We like the fact that a third-party will support the product, but on the other hand, custom developing something ourselves gives us tight control over the feature set without having to wait for release cycles from a vendor. But, if we can take an existing free product and, with relatively little effort, modify it to do what we need, then I would be neglecting my fiduciary responsbility as an officer of the company to purchase a third-party product and pay a continuing stream of license and maintanence fees.

    We are only at the beginning of exploring what heatmap technology can do for us, and in addition to Panopticon, there are other fish out there like Fractal Edge (makers of what I like to call the Undulating Amoeba heatmap!)

    If there are any of you out there who have used or evaluated heatmap products, I would love to get your comments.



    ©2007 Marc Adler - All Rights Reserved

    Thursday, August 16, 2007

    It's the Models, Stupid

    I just can't think that, in the world that we deal with, our efforts spent on low-latency, code optimization, high throughput, best algo containers, etc ... are worthless if the models are not good.

    Doesn't matter how fast you get your trades out to the exchanges if you are always on the wrong side of the trade.


    ©2007 Marc Adler - All Rights Reserved

    Saturday, July 28, 2007

    Trading Floor

    I am straddling two positions at the moment. I am still at my current position as SVP of Equity Derivatives at my company, but I am also doing a slow transition to the Derivatives Analytics desk on the business side. So, for the latter role, I have been sitting on the massive Equities trading floor at my company.

    The contract in the physical difference in the two roles is stark. In my position in Architecture, I sit in a big office in an old Lucent campus in the middle of North/Central New Jersey, about 35 miles from Allentown, Pa. The place is almost like a morgue ... I could go there, sit in my office, and not see anyone for an entire day.

    On the other hand, the trading floor is located in the middle of very hip Tribeca. This is not your father's Tribeca. You have 20 gourmet restaurants within two blocks of my office. You can look out the 20-foot windows that overlook the Hudson River and see the Statue of Liberty. You can see pretty girls walking across the floor all day long.

    When I am sitting at the Derivatives Analytics quant desk, there is the amazing energy that accompanies a trading floor. I was lucky enough to be on the floor for these last two trading days, where the Dow dropped 500 points. There was cheering, shouting, tension, madness. It reminded me of the old days, when I started out on Wall Street as a consultant for Goldman Sachs, and then went to consult for Drexel Burnham. In those days, we developing the first cut of Windows-based trading workstations, so we would always get traders who looked over our shoulders, commenting on our work.

    It has been no secret that I am fascinated with the quant world. I am sitting with truly brilliant people who talk a different language that I barely understand. Even though the quants at my desk are 50% Russian, they talk in English, throwing around terms like Kurtosis and Skew Risk, terms which have me madly scrambling to Google. Terms which may me wish that I had not shown up drunk to Statistics 101 class every day in college!

    It is interesting to have these quants coming up to me, apologizing for their code. Maybe I can teach them a little bit about software and architecture, and they can teach me how to Delta Hedge my portfolios!

    ©2007 Marc Adler - All Rights Reserved

    Friday, June 22, 2007

    Next Gen Heatmaps of the Markets?

    The next generation of heatmaps?

    http://www.ted.com/index.php/talks/view/id/129

    Can we also employ tactile feedback using Microsoft Surface? So we can FEEL the market? Make the hot areas really generate heat?

    ©2007 Marc Adler - All Rights Reserved

    Saturday, June 16, 2007

    The Flavor of the Month is Acropolis

    Now, after touting CAB for a few months, Microsoft has announced Acropolis.

    A few months ago, the Microsoft DPE team came to me and tried to dissuade us from developing our .NET client framework in favor of using CAB. However, during those conversations, the word Acropolis came up a few times.

    Now that Microsoft is touting Acropolis, what has become of CAB? Will this now be an officially supported framework (remember ObjectSpaces?). What about all of the financial service developers that committed to CAB? And, now you have some Microsoft people telling us that CAB was never officially supported by Microsoft, that it was developed by a small group of independent developers in some far off country that nobody ever heard of!

    One thing about developing your own framework and making it a standard in the company is that it won't turn into a flavor-of-the-month entry. Goldman lead the way with OCEAN. Wachovia has OneSource, and Morgan Stanley has FidSharp and Concord. And we have ours. And, our companies tell our developers that they should use it.

    No doubt that Acropolis will be "better" than CAB, and will have learned lessons and anti-patterns from CAB usage. Only, what will Microsoft come out with in another 6 months?

    ©2007 Marc Adler - All Rights Reserved

    Short Sell Any Time

    (Thanks to Wall Street Folly)

    The SEC voted unanimously on Wednesday to finally get rid of the pesky and ridiculously outdated tick test. The tick test only allows short sales when the last sale price is higher than the previous price. That means a trader cannot short a stock if the movement prior to the short sale is down

    Wonder what this means for all of the models out there? (I mean HFT and Algo models, not Giselle Bunchen-type models... but, I am sure that Heidi Klum is overjoyed too!)


    ©2007 Marc Adler - All Rights Reserved

    Fun with Patents in Financial Services

    It's great fun to browse the United States Patent Office to see what your colleagues have come up with in the financial industry. It's even more fun to see who has patented what. In the search page, type your favorite company into the "Assignee" field. Even though you and I can create a great technology, and we *may* be able to be listed as the Inventor, we usually have to Assign the work to the company we work for.

    Just take a look at one of the patents. It's from Goldman Sachs. Andy Smith is the creator of Goldman's .NET client framework, OCEAN. In that respect, we are counterparts.

    It's also fun to se who was credited as the Inventors of a technology. For example, some Merrill Lynch patents list (the late) Don Trojan and Ed Keenan as the Inventors. I know for a fact that Don and Ed were managers at Merrill, and in my opinion, probably never got anywhere near the technology. (Ed was my wife's first boss at ML, and was a pure manager. Don was my wife's boss at Drexel Burnham Lambert.)

    If you want to see the diagrams that are associated with the patent, then click on the Images link. However, you need to download a TIF viewer for your web browser before you can view the images.

    As I write this, let's see if some of our favorite characters have patented anything....

    John Powers of Digipede : Nothing.... But don't look at this and this.

    Geva Perry of GigaSpaces : Nada .... (Maybe they have patents in Israel?) But let's try one of GigaSpaces' competitors, Gemstone. Well, lookee here and here. And here.

    You guys should learn the lessons of old Xerox, and make a beeline to your favorite patent attorney! Patents are some of your greatest assets.

    ©2007 Marc Adler - All Rights Reserved

    Thursday, June 14, 2007

    Google Spam

    I have been fairly sparse on this blog lately. I have been incredibly busy at work. But, the main reason is that Google had mistakenly tagged my blog as a spam blog.

    Everything is back to normal now.

    ©2007 Marc Adler - All Rights Reserved

    Favorite new blog

    http://enhyper.blogspot.com/

    A lot of good stuff on implementing HPC within financial services firms.

    The author of the blog just took a job with 29West in London, the makers of LBM (Wombat is a big user of LBM). He regularly hosts drinking sessions in London with interesting guest speakers.

    (Since I showed Terry the blog, he has already found more reasons to stay late at work. Sorry, mate!)

    ©2007 Marc Adler - All Rights Reserved

    Object Caches for .NET

    Reminder to self ---

    Now that Tangasol, Gigaspaces and Gemstone have native .NET APIs for their caches, I need to re-evaluate the three. The advantages of distributed object caching is being picked up by some other groups in my company.

    ©2007 Marc Adler - All Rights Reserved

    Heatmaps

    I decided to integrate the Treemap control (ie: Heatmap) from Microsoft Research into my .NET client-side framework that my company now uses. As a demo, I emulated the heatmap found on the Smart Money site. The free Microsoft heatmap was fairly easy to develop for, and in almost no time, I had real-time trades streaming from KDB+ into the framework, with the trade data displayed in the heatmap.

    Given what we have, it may be more difficult to rationalize paying that big yearly license fee to Panopticon.

    The Bubble Chart control is worthwhile too.


    ©2007 Marc Adler - All Rights Reserved

    WPF and Vol Surface Editors

    Microsoft came in the other day and showed some Silverlight and WPF demos. Infusion Development wrote a demo of a vol surface viewer (not an editor). According to the guys from MSFT, you can actually embed the WPF control within a .NET 2.0 Winforms app.

    Our main col surface editor was written upteen years ago, using Open GL. It would be interesting to see how a WPF vol surface/curve editor would compare, especially when the CPU is busy handlign feeds and calculating greeks.


    ©2007 Marc Adler - All Rights Reserved

    Anyone going to SIA?

    I will be at the SIA convention on Tuesday, June 19. Big Microsoft/Intel party afterwards.

    Anyone going?

    ©2007 Marc Adler - All Rights Reserved

    Looking at ACE

    Looking at high-performance frameworks for writing distributed systems, especially for high-frequency trading. ACE has been on the radar screen for a while.

    http://www.cs.wustl.edu/~schmidt/ACE.html

    I also found out that Bloomberg is using it in their PhatPipe product.

    ©2007 Marc Adler - All Rights Reserved

    Friday, May 25, 2007

    Performance Architect Wanted

    Haven't posted in a while ... I have been super busy. My .NET client-side framework is taking off in a big way. I am off architecting other interesting things that bring me in touch with messaging acceleration, KDB+, visualizations, and more.

    My new intern starts on Tuesday. Every year, we get a bunch of interns from the top universities who have just completed their Masters or PHD in comp sci or physics. Mine will be devoted to expanding and maintaining my framework, but he has a lot of interests in hardware accel too.

    Ted, our performance architect, has left the firm for a great new job at AB. So, we are looking for a great performance architect to work in Warren, New Jersey. Let me know if you are interested.

    ©2007 Marc Adler - All Rights Reserved

    Wednesday, May 09, 2007

    Somasegar, who I gather is the head of the Visual Studio product line, blogs that Microsoft will be giving full support to multicore processing in their dev tools.

    When I was out in Seattle a few weeks ago, I met with the Microsoft Accelerator team about the future of their technology. Also their stuff is wed to GPU's right now, the Accelerator team claims that it can be used as an abstraction for multicore systems. The guys from the Accelerator team also predict that the world will eventually be moving to massively multi-core machines (ie: Intel's 80 core processor)

    Word is that both Credit Suisse and Goldman have teams devoted to exploring FPGA technology. The problem with FPGA is the amount of effort that goes into porting code, and the entire develop/build/debug cycle is very slow.

    It will be nice to get first-class support from Microsoft as far as development tools go.

    ©2007 Marc Adler - All Rights Reserved