Saturday, March 31, 2007

QuickFix and Enums

It seems that the latest version of QuickFix has a .NET assembly and FIX 4.4 support, so I am going to be using it in an OMS demo that I am putting together to show off my .NET client-side framework.

One thing that I wish that the QuickFix guys did was to use enums instead of static const chars. For example, here is the definition of the OrdType class (this class is written in Managed C++, but a lot of the other .NET classes are in C#).



public __gc class OrdType : public CharField
{
public:
static const int FIELD = 40;
static const __wchar_t MARKET = '1';
static const __wchar_t LIMIT = '2';
static const __wchar_t STOP = '3';
static const __wchar_t STOP_LIMIT = '4';
.............

OrdType() : CharField(40) {}
OrdType(__wchar_t data) : CharField(40, data) {}
};


I completely understand why they used const chars, but for data-binding purposes, it is easier for me to use enums.

I wonder if I should reflect over a few classes and translate these classes to corresponding enumerated types.

I'm supposed to be a manager .. I have to find other people to do this kind of stuff for me. However, in my group, I am the only .NET person in a vast sea of Java-ness.


©2007 Marc Adler - All Rights Reserved

ITSDoc.org Redux

ITSdoc.org is still very much alive. It recently passed its millionth page view and it gets hits from all over the world every day. It strives to be helpful to coders (hopefully open source) of Investment and Trading Systems by assembling into one place a great set of documentation.

Personally, I have been drawn away from driving ITSdoc forward for about a year now volunteering actively at FIX on a standard that will cover the next generation Algorithmic order types. I’ve got to say, volunteering at FIX and mixing it up with the fantastic people in the various technical Work Groups and Global Technical Committee has been wonderful! They have a bunch of brilliant people who all selflessly volunteer tons of time to the betterment of the industry through a FREE standard. Plus, it’s been a real great eye opener on exactly how the largest industry players cross connect. Mind you these same people go back to their firms and compete vigorously.

Last summer our Algorithmic Order Standard Work Group conduced in-depth interviews with five MAJOR order management system (OMS) vendors as well as considerable secondary research into the adoption trends in algorithmic orders types. Much of that learning was incorporated into the proposed standard, which is in the final stages of official adoption at FIX. In just a few weeks its expected to enter the pilot testing phase. See http://www.fixprotocol.org/working_groups/algowg/documents

FIX is a bit more complex than the average open source coder of Investment and Trading Systems might like to struggle with, starting with the printed protocol specification alone. There are many tags and enumerated values, the various messages can be complex and there is a substantial learning curve. There is one outstanding open source FIX engine out there QuickFix, available in C++ and Java, but due to the complexity of the FIX standard it’s quite complex to implement. In the future ITSdoc hopes to help lower the bar to adopting FIX, and help get around using all those nasty, expensive, dedicated IP circuits.

Dealing with emerging ISO standards this past year has also been challenging. If you are designing an open source Investment and Trading System your internal data models need to comply with various standards (including various versions of standards, service packs, extensions, customizations, variations in usage, etc). Needless to say all these different “flavors” and “dialects” of the various standards often don’t mesh well with each other. However, the situation is slowly improving. XML is now everywhere and XSLT can ease (but not eliminate) the pain of making translations.

The ITSdoc UML project is on hold for the moment. I went to write up a meta Use-Case on processing text news during investment decision-making and got mired down with various sub topics such as bias in news coverage. My background includes some work in cognitive psychology and I was perhaps too far down in a “deep dive” on the subject. When I caught myself with a new book on psycholinguistics I thought to myself, you’re in pretty deep, perhaps its time for some decompression. Still the material is fascinating and to a degree exceedingly relevant to investment decision-making. Getting a handle on it however has proven very time consuming. I have a ton of great material but getting it all into publishable format has been constrained by the “hours in the day” limit.

So, plenty going on behind the scenes at ITSdoc. Coders of open source Investment and Trading Systems are very much encouraged to register at the site. We shoot for quality over quantity. Plus, we can often hook people up with other “birds of a feather” who are interested in similar things.

Rick

Http://ITSdoc.org

©2007 Marc Adler - All Rights Reserved

Monday, March 26, 2007

FIX serializer for .NET

Anyone know of a FIX (and FAST and FiXML) serializer for .NET ... something that will reflect over an arbitrary object and produce a FIX string? I imagine that you will be able to tag an object with custom attributes that let you specify the FIX tags.

©2007 Marc Adler - All Rights Reserved

News from the Front

Wall Street Tech writes on the hardware arms race going on now in Wall Street. According to the article, names evaluating hardware acceleration include Merrill Lynch (IBM Cell processor), Citigroup, and Mellon Financial.

Oracle just bought out Tangasol. I predict a Microsoft/Gemstone deal in order to make the Windows CCS stack a bit more attractive. You heard it here first. Gemstone just came out with a native .NET implementation of Gemfire, so it probably makes much sense for Microsoft to gobble them up before Oracle uses the .NET version of Tangasol as a lever to sell more Oracle DBs into Wall Street.


©2007 Marc Adler - All Rights Reserved

Friday, March 23, 2007

Windows Workflow and Auto-Execution?

In preparation for Joe's lecture next week on Windows Workflow Foundation (WF), I am reading a book by Kenn Scribner that just came out on Microsoft Press.

WF has a rule-based workflow engine. I am wondering how application this would be for auto-execution engines.

Also, the middle-office guys have asked me if WF can be used to replace Fuego. I don't know anything about Fuego, but hopefully, Joe can answer this.

I am most excited to see how I can integrate WF with the .NET client framework that my team is writing. I know that Merrill Lynch is doing a lot of things with WF, so it looks like there are some good use cases in the capital markets sector. OMS's? EMS's?


©2007 Marc Adler - All Rights Reserved

Wednesday, March 21, 2007

My Son's Band at The Starland Ballroom

Cartesia, my son's band, played at the Starland Ballroom on March 17, 2007. Starland is the local mecca of hard rock, punk, and metal in Northern New Jersey. My son is the skinny thing playing drums and singing.



©2007 Marc Adler - All Rights Reserved

New York XTC Club

Mike Roberts hosts the monthly meeting of the New York XTC club, held on Tuesdays at some place that serves an awful lot of Belgian beers. This is a good excuse to make the trek into NYC on a Tuesday.

By the way, XTC stands for "eXTreme Chugging" ... but seeing what kind of state Mike was in, it probably stands for "eXTreme Chundering".

Congrats to Mike for leaving Finetix and taking a new position. A long time coming...


©2007 Marc Adler - All Rights Reserved

I Got a Tech Writer !!!

Read it and weep, people ....

I got myself a real live technical writer for a few months. She has even done Visual Studio and MSDN documentation for Microsoft.

In all of the major projects that I have done for IBs, I have never seen the budget for a tech writer. We usually have to do it ourselves, after we are totally exhausted from delivering the technical aspect of a project. We might be lucky to get a BA to do some of the functional docs, but they will never dive into code.

This young lady who I now own actually installed Visual Studio on her laptop, and started stepping through the code!

©2007 Marc Adler - All Rights Reserved

Grids and Scavenging

During our meetings with the Windows Compute Cluster Server team last week, it came out that CCS does not do any sort of scavenging, nor or their immediate plans to implement it.

Scavenging is an important way to lower the costs of the grid and to gain wider acceptance by letting groups make some money by charging back the use of their spare CPU cycles to the organization. Imagine all of those hundreds of idle CPUs gathering dust in a large Disaster Recovery center at an investment bank. I think back to Morgan Stanley's DR center, with hundreds of cubicles of untouched CPUs.

Would the absence of a scavenging feature eliminate a grid for you?

Does DataSynapse or Digipede have scavenging?

©2007 Marc Adler - All Rights Reserved

Sunday, March 18, 2007

Microsoft - You're Almost There

I went out to the Microsoft MVP Summit as one of the 20 or so specially invited "Industry Influencers"... which means two things. First, we are supposed to be able to influence Microsoft's future directions. Second, we are supposed to be shown the love by Microsoft so that we can buy lots more products.

What I came away with was that

1) Microsoft is stil very much focused on the desktop and the world of two-tier apps.

2) There are a lot of parts that can be assembled into a killer stack for cap markets, but that there is no overall strategy to congeal the parts.

3) Microsoft needs to look beyond its borders to what is happening in the industry, and to integrate better with third parties.

I get the feeling that we are on the cusp of an incredible stack from Microsoft, but the parts needs to be put together in a cohensive manner. Mike Walker is charged with providing reference architectures for the financial vertical, but Mike needs some assistence from us in understanding the trading stack.

©2007 Marc Adler - All Rights Reserved

Friday, March 16, 2007

The canned presentations of LINQ/PLINQ at the MVP Summit were very interesting, but more questions were raised than were answered. It also was apparent to us Capital Markets people that Microsoft still does not treat our environment as a first class citizen.

Here are some of the questions I had:

No support for async operations (Dinesh from the LINQ group told us that teh query operations are blocking)

No Support for notifications. In many scenarios, if records on the back-end database change, our apps need to be notified asynchrounously. This is what Service Broker is designed for. I would like to see first-class language or API support for receiving async db notifications to a callback function or delegate, or maybe have something integrated with ObservableSet.

Support through WCF or other mechanism for 3-tier apps using transports like Tibco RV/EMS and MQ. LINQ really seems designed for 2-tier apps.

Integration of PLINQ with efforts like Compute Cluster Server.

Support for security and integration within C#

Comparisons with (N)Hiberate and IBattis. These are used extensively in CapMarkets.

Integration with object caches like Gemfire and Gigaspaces.

Possible extensions for time-series (ie: like Streambase)


©2007 Marc Adler - All Rights Reserved

Sunday, March 11, 2007

A Comment from Gemstone

Ocassionally, someone will make an important comment to a post I made several months ago. Such is the case now ... Jags from Gemstone replies:

You have hit the nail on the head. At GemStone, we recognized early on that a distributed cache that supports notifications has no choice but to ensure that object change notifications can reliably reach consumers. Else, it pretty much becomes useless.

There are many considerations we took into account:-

Applications are sharing data through a p2p cache and the cache supports dynamic membership - i.e members can come and go at any time. Great from a scalability perspective, but what happens when you have apps connected to the peer cache expecting notifications and a peer node generating the events suddenly departs? In GemFire, we introduced a declarative means to ensure that messages are received by all critical members - each producer or consumer can play one or more roles; A publisher only succeeds if the roles that are required are available. If this interest you, checkout section 3.2 here

http://developer.gemstone.com/display/gfedev/Topologies+and+Architectures+for+Middle-Tier+Caching-

In the scenario you mention - clients connected to a logical cache - we also support asynchronous reliable notifications through in-memory replication of the queues on the cache servers. The challenge here is to ensure in order delivery of events, detecting the failure conditions, automatic client failover to the server managing the secondary queue and avoiding duplicate notifications. And, given that there might be a local cache on the client, the server side can further optimize transmission to the client by merely propagating a object "delta".

One important reason why financial institutions like the whole "caching + messaging" story is because now you enable applications to connect to a distributed object repository that gives pub-sub semantics, but all the contextual data required by the application to make instantenous decisions is available in memory.


©2007 Marc Adler - All Rights Reserved

Saturday, March 10, 2007

Off to the MVP Summit

See some of you at the Microsoft MVP Summit starting on Monday evening?

What's important to me is to see Microsoft's directions on Capital Markets. I would liek to see a cohensive story on:

- Grid computing (Windows CCS and possible synergies with Digipede)

- Quasi-realtime Analysis Services, with associated WPF visualizations

- Support for parallel constructs in C#/NET (Microsoft Research Accelerator for GPUs)

- Any forward movement for Complex Event Processing


©2007 Marc Adler - All Rights Reserved

StreamBile

We love bile here! Here is a little bile from Mark Palmer on Apama:

http://apama.typepad.com/my_weblog/2007/03/streambase_algo.html

while giving some kudos to Kaskad. According to this page, Mark Palmer is the VP of Complex Event Processing at Progress Software, a competitor to Streambase.

Judging by some recent comments on Matt's blog, it seems like the CEP vendors relish in sniping at eachother. More bile! We love it!

Meanwhile, we hear from Terry that Gemstone has been impressive with their recent release of a native .NET client. Coming right on the heels of similar announcements from Gigaspaces and Tangasol.

©2007 Marc Adler - All Rights Reserved

Wednesday, March 07, 2007

Bonus Satisfaction Results

http://news.hereisthecity.com/news/business_news/6552.cntns

Results of a survey about the 2007 bonuses

©2007 Marc Adler - All Rights Reserved

Monday, March 05, 2007

Thanks to James

.. for pointing out something something simple and forcing me to spend a half hour simplifying my code ....

Sometimes people justg get tunneled into thinking about a piece of code in a certain way .. that's why we have code reviews...

©2007 Marc Adler - All Rights Reserved

Sunday, March 04, 2007

Antelope Natural Language Processor for .Net

http://www.proxem.com/

Free NaturalLanguage Processor for .Net 2.0.

Worthwhile if you are going to construct a semantic analysis engine from scratch.

I have been reading up on NLP. Take the sentence "Time flies like an arrow.". How many different semantic meanings does this statement have? Now imagine getting a news feed of financial information. How would you parse the news into an ontology that equity traders can work with? And how would traders use this information?

Matt is exploring the CEP engines right now (Streambase, Coral8, etc). I would be interested to see if and how these CEP engines can handle news feed. What kind of info would they need?

©2007 Marc Adler - All Rights Reserved

Monday, February 26, 2007

Flying with Rich

I went flying this past weekend with Rich. It was very windy. It was so windy that, when we pointed the nose directly into the wind and put down the flaps, we were able to make the plane go backwards in the air.




Rich flew co-pilot in my Mooney 20G. Rich owns a very big mutual fund. Rich has a TBM 700. I hope I fly Rich's plane some day.

My wife always asks "Why don't you work for Rich?" I say that friends and business never mix, and friendship is always more important. Silly Marc.

©2007 Marc Adler - All Rights Reserved

One of my Son's New Bands

They are playing at the Starland Ballroom (the local mecca for punk, hardcore and metal bands) in Sayreville, New Jersey on March 17.


©2007 Marc Adler - All Rights Reserved

Saturday, February 24, 2007

Barcap Boom

Word has it that the developers at Barcap are jumping for joy at their bonuses this year. After several years of sub-par bonuses, and difficulty last year in bringing new developers on, Barcap finally saw the light and rewarded their hard-working devs with a decent chunk of change.

Companies should realize that Wall Street is an extremely small, tight-knit community, and that word of good and bad bonuses spread like wildfire. In order to retain good talent and hire new talent from other companies, a firm has to have a good reputation with regards to bonuses in the IT department. It doesn't matter if your traders and sakesmen are getting 300% bonuses ... it's the IT department that has to write and maintain the systems that drive trading operations.

Consider the cost of losing the only person on a team who knows the code of a complex system. Think of the time you have to spend hiring a replacement (taking time from employees to do the interviews, headhunter fees, sign-on bonus, etc), doing the knowledge transfer, and waiting for the perosn to get acclamated to the system. How much does a company spend when it loses an experienced hire and tries to bring on a new one? Would that amount of money, if applied to a bonus, suffice to retain a talented individual?

Often times, it is not the fault of the IT managers. It's a matter of convincing the business that IT really matters.

©2007 Marc Adler - All Rights Reserved

Sunday, February 18, 2007

Saturday, February 17, 2007

Separated at Birth

Don Demsak (DonXml) and Kent Tegels (Enjoy Every Sandwich).

Kent is the SQL Server curriculum developer at DevelopMentor. I took his most excellent course this week. I was surprised to see that I was the only person with a manager title in there. Surprisingly, lots of Visual FoxPro people were there. I didn't know that anyone used VFP in a corporate environment.

Don, Kent and I hoisted a few beers and claws at Ulysses Pub on Stone St, right in back of the Goldman Sachs building. Both will be at the MVP Summit in March, and I hope to attend sessions that are being hosted by their respective groups. I also hope that a lot of the "shortcomings" in SQL Server 2005 that Kent pointed out will be addressed by Microsoft in future releases.

©2007 Marc Adler - All Rights Reserved

Spring.Net supports JMS

True to his word, Mark Pollack has delivered JMS message integration in the latest version of Spring.Net.

I also need to check out ActiveMQ. They have integration with C#/.NET through NMS. It would be interesting to see if there will eventually be some integration with WCF. I will certainly bring this up at the MVP Summit in March.

©2007 Marc Adler - All Rights Reserved

Syncfusion for Hierarchies?

According to Chris, the Syncfusion Grouping Grid is giving his developers heartburn when it comes to all of the hierarchical and grouping related functions. Syncfusion certainly has its place in a simple, one-dimensional world, and will probably be continued to be used by Wall Street companies for real-time blotters. But this opens up the door for companies like Infragistics and DevExpress to come up with a really fast, bug-free, grouping grid for the kinds of blotters that we know and love so well.

©2007 Marc Adler - All Rights Reserved

Farewell to The Scotsman

Our token Scot has moved on to make Market Data Magic at another firm. One of the truly great market data experts in the world ... I am sure that we will be meeting at the Brandy Library for a snifter or two, if you can manage to drag yourself downtown (take the S or 7 to Times Square, then take the 1 downtown to Franklin Street).

I might even get Mike Roberts to join us, since he seems to be a frequenter of that establishment. (Mike, take the 2 uptown to Chambers St, transfer for the 1.) Maybe we can convince him to move his Tuesday Night XTC club to the Brandy Lib. Wouldn't it be fun to try to convince Mike (the author of CruiseControl.Net, when he was at Thoughtworks) to join our little group as the CI/Agile expert.... We can even get CD down so I can steal some dispatch patterns from him.

©2007 Marc Adler - All Rights Reserved

HPC on Wall Street - Hardware Acceleration

Sam Brown of the University of Utah just came out with some slides on his initial forays into hardware acceleration. He contrasts the use of Cell Processors, FPGAs, and Multi-core processors. He was trying to speed up 2-Way Wave Equation Modeling, which is not a financial application, but the lessons that he learned can be applied to those of use who are doing (or exploring) HPC in Wall Street.

The big effort is in unrolling loops and parallelizing your code. Using the POSIX PThread API and multi-core cpus is the easiest thing to do. With 4 threads (2 dual-core 2.2 Ghz Opterons, 4 GB RAM), he got a 11x improvement on one set of benchmarks, and a 2x improvement on the big application.

The FPGA system used the Altera Stratix II FPGA. He got about a 14x improvement on the initial set of benchmarks, but the development effort was a lot harder. It took 12 hours to get the design onto the FPGA chip.

The Cell systems were a Sony Playstation 3 (!!!) and a IBM Cell Blade with 2 Cell Processors with 8 SPEs each (a Cell processor has 8 SPEs, which function as coprocessors.) The Cell results were generally disappointing, with the author wondering if he programmed the Cell correctly. One thing that I have heard about the Cell is that it is very difficult to program. Perhaps companies like PeakStream can help you with this effort.

(For instant gratification, the money shots are slides 28, 29, and 30)

What can hardware acceleration do for you? Faster pricing of derivatives. Faster generation of risk values, especially for exotics. Better overnight stressing.

The problem is in acquiring the skill set to parallelize algorithms, deal with the development environments (especially debugging), learning new variants of C, and getting buy-in from the business.



©2007 Marc Adler - All Rights Reserved

Friday, February 16, 2007

My New Favorite Place

The Brandy Library is in the TriBeCa section of New York City. Plush furniture, wood-paneled walls that contain top-shelf liquor, amazing scotches and brandies, interesting tapas to knosh on.

My scotches for the evening were Ardbeg Uigeadail and Caol Ila (18 years). Jerry was sipping their Hot Apple Cider all night. To top it off, a great "hot chocolate".

(I am not affliliated with the Brandy Library in any way ... just a satisfied customer.)









©2007 Marc Adler - All Rights Reserved

Sunday, February 11, 2007

Sharing XSDs between .NET and C++/Win32

Free products for generating C++ code for XSD's :

http://www.codesynthesis.com/products/xsd/
http://freshmeat.net/projects/xsd/

A further list of products can be found at http://www.w3.org/XML/Schema

I am in the market for a FREE XSD->C++ code generation tool that I can use to share schemas between .NET GUIs and C++/Win32 servers. Matt pointed me to these two.

What is the best JaxB/Castor equivalent for the C++/Win32 world? I'll let you know when I have finished my evaluation.

(Morgan Stanley makes it easy with CPS and their SOAP libs... every firm should have one of these)


©2007 Marc Adler - All Rights Reserved

Friday, February 09, 2007

Just returned from London, where 2 inches of snow managed to shut down most of the city. Even the newscasters on Sky News were lamenting the fact that London (with one week of advance warning) cannot seem to deal with white powder.

Got together with some ex-colleagues, who were marvelling at the Lodnon consulting market.
The hot areas are Grid Computing, with the prevelant stack being DataSynapse and Tangasol. Also demand is picking up for WPF, with Morgan Stanley leading the way. The daily rates for qualified individuals are about 1000 pounds per day, which at the current exchange rates, is about $2000.

There is a well-known financial consulting firm who shut down its London offices last year, telling employees that they were losing money and that there was no money to be made in the London market. Hmmmmmm.....

It will be interesting to see if Microsoft's Compute Cluster Server and Digipede can make any inroads intot his market. There seems to be a very strong bias against using .NET for a grid infrastructure, something which I hope to see turned around in 2007.

I got a chance to walk around Canary Wharf a bit more this time. I hope that JL gets to go to the Gaucho Grill (Argentinian Steaks) and Nobu (Japanese) on his upcoming trip. But I need to have TS take JL out for a night of karaoke, and take some pictures to prove it! (Our karaoke outing got cancelled because of the snow .... to the relief of the collective ears of the London Equities Architecture group!)

©2007 Marc Adler - All Rights Reserved

Welcome Back Crispin

Crispin has a new blog ... but you'll have to find it for yourselves!

©2007 Marc Adler - All Rights Reserved

Syncfusion GridControl vs GroupingGrid

I am starting to write the grid abstraction for my client-side framework. Developers will code to a "virtual grid" API, and there will be adapters for the actual implementations of the grids (Syncfusion, Infragistics, WinForms, DevExpress, etc).

Because most of Wall Street uses Syncfusion grids for trading apps, this is the first adapter that I need to write.

Syncfusion has 3 different grids: the regular old GridControl, the DataBoundGrid, and the GroupingGrid. The grouping grid is used a lot in my place to provides rollups of data. You would think that the GroupingGrid would inherit from the GridControl, but unbelievably, it does not. The API sets are not even consistent.

I have spent my time using Lutz Roeder's very excellent Reflector to try to hunt and peck through the Syncfusion class hierarchy in search of the various classes and functions in the GroupingGrid that implement the same functionality as the GridControl. The fact that I am dealing with two incompatible API sets has increased my work by 100%.

C'mon Syncfusion ... you should know better than that!


©2007 Marc Adler - All Rights Reserved

Friday, February 02, 2007

New York Code Camp

DonXml is organizing a Code Camp on Saturday, March 3, in New York City. Last year's camp sold out in 24 hours and they had to max out at 150 attendees. This year, they expanded the number to 400, so there should be plenty of room.

Don is looking for speakers, especially from the financial sector. So, all of you people from Goldman, Morgan, JPMC, Citi, DB, Barcap, Lehman, hedge funds, etc .... get ready to spill the beans! Come tell us all how you are using .NET at your jobs.

Don is also trying to organize a Java/.NET Code Camp in New Jersey, and is looking for some company to donate space. Get in touch with Don if you are a North/NorthCentral-based organization that can donate some conference facility for one Saturday.

©2007 Marc Adler - All Rights Reserved

Microsoft MVP Summit

Although I am not a Microsoft MVP, I have been invited to attend this year's MVP Summit in Seattle as one of the 20 "Influencers" of .NET technology. I hope to see some of the readers of this blog over there and share in some good Washington State microbrews. The summit runs the week of March 12. (Big shout out to Joe Rubino for this event...)

Coming from the capital markets sector, I will be most interested in the following:

Windows Compute Cluster
- how can Microsoft compete with establish grid players like Platform
- how do they cooperate with other grid vendors (ie: Digipede) that we might want to use for some lighter projects
- tie-ins with Excel Services

Analysis Services
- how can we use Analysis Services to perform risk analysis
- how can we use AS in a quasi real-time mode to perform real-time risk analysis and performance attribution

WPF
- what new compelling visualizations for trading systems can WPF give us
- performance aspects of WPF for trading systems

WCF
- would love to see WCF expanded to Tibco RV and EMS. That wouold give it more bang in the Capital Markets area.

SQL Server
- what is coming down the pike for SS that would be most applicable to our systems (time-series, complex event processing, etc). Will they be doing anything to get into Vhayu's and Streambase's space?

Capital Markets Strategy
- I have been very vocal with Microsoft about their (lack of) coherent strategy for Capital Markets. I want to see what plans they have for the entire stack. Let them demonstrate to me that they are think about coming out with best-of-breed components along the entire stack, and that people will take Microsoft seriously for server-side components.


©2007 Marc Adler - All Rights Reserved

Thursday, February 01, 2007

Off to London Again

I'll be in London again on the week of February 5, so I will be moderating the comments sporadically during that week. A week of hard work, and a kareoke session on Thursday night. The last time I was there, I found that the Brits could not handle their tequila shots very well (The Aussies and Kiwis were only slightly better). They have promised to practice while I was away .... we'll see if their hard work paid off. Maybe Terry will take a few photos...

©2007 Marc Adler - All Rights Reserved

Sunday, January 28, 2007

Dissecting a Wall Street Job Posting

A lot of you have emailed me privately with questions about working on Wall Street, and how to land a job there. (I assume that the questions are coming by email because everyone is afraid of their bosses tracing the IP addresses.)

I would like to take a recent job description that was on the 96Bosses.com site and dissect it.

Here it is:

=======================================================

Job Description
Our client, a top-tier global brokerage firm, is seeking multiple C++/Java Developers to work on an a real-time algo trading platform for their US Equitites trading area. This is a fulltime opportunity located in New York City, NY.

Qualifications
Experience in designing and implementing high speed trading system that can be used for algorithmic automated trading and smart order routing.

Prior experience in US equities trading environment is essential. Prior experience in US options/futures trading environment a plus. Prior experience in UK/Asia markets a plus. Knowledge of building automated trading systems and/or exchange connectivity is a big plus.

• Strong technical programming skills is a key requirement. The Object Oriented Design and Programming is essential. Knowledge of design patterns is also key. Hands on expertise in programming in C++ and Java (server side programming) is necessary. In depth knowledge of multithreading, exceptions, template etc.

• Needs to have strong expertise in inter process communication and event driven programming
Projects will include:

• Algorithmic Trading
• Automated Market Making
• Smart Order Routing
• Trade Analysis for Equities, Options and Futures in US Domestic and International Markets

Experience with the following products:
• TIBCO Messaging Services
• Ticker Plant
• Times Ten
• GemFire
• Transact Tools (FIX Gateway)
• Web servers (Tomcat/Weblogic)

Compensation
$150 -$300k

========================================================

The work is for an Algorithmic Trading platform. This is a good thing. Wall Street is becoming more and more automated, with the NYSE reducing floor space and a number of firms paring their trading staffs.

Algo trading is a very hot area. Firms want to trade large blocks of stocks without affecting the marketplace. The trading has to be broken up into a lot of small blocks, according to different strategies. The firm also has to be able to switch strategies in mid-stream. This requires monitoring the marketplace in real time, and keeping an intraday history of the stocks that you are interested in.

The firm is looking for experience in high-speed, low latency trading. Latency is everything. You want to get yourselves out there faster than all of your competitors. Latency can be affected by many factors, from speed of the networks to inefficient locking algorithms in your code. There is also a need for experience in smart order routing, which means that you might get to work with some kind of rules engine, like ILog Rules.

Let's look at the technology stack.

- Tibco is being used (either Rendevous or EMS), probably to get the spot prices from the ticker plants into the algo trading server. (Watch out for those multicast storms...)

- "Ticker Plant" probably means something like Reuters or Wombat. If the job is for Merrill, Bear Stearns or RBC, then most likely that Wombat is being used,otherwise most likely Reuters.

- Times Ten is an in-memory database (now owned by Oracle) that is probably being used to hold tick history. Other solutions in this area include KDB+, Vhayu, StreamBase, and some of the newer players that I have talked about on this blog in the past. These newer time-series databases can be used to perform complex event processing on the incoming tick stream.

- Gemfire (by Gemstone) is a distributed cache. This is probably being used to cache queries to the reference data. The use of Times Ten may mean that you will have an Oracle database.

- Transact Tools TTConnect will be used to send and receive FIX messages between your Algo server and the various exchanges. FIX is the standard message format that is used to send equity orders to exchanges and to receive updates about the status of your orders. Latency is extremely important here too. How fast can you get your messages to and from the exchanges.

- Web Servers. Perhaps for some web apps that will be used to monitor status. I would expect to see a .NET front-end here. The fact that .NET is not on the stack makes me believe that the job is not for Goldman nor Morgan Stanley, where .NET front-ends are "de riguer".

Now, onto the compensation. 150-300K ... That's a pretty wide range. The 300K might lead me to believe that this position was for a hedge fund, but the first line tells me that it is a top-tier global brokerage firm. If you take the word "Brokerage" literally, then this would eliminate Lehman, Goldman, and Bear Stearns. Base salaries go from about a low of 130K to about 160K, with 150K being the norm. So, if the total comp was 150K, then you are not getting much of a bonus, are you? Let's take 150K as being the base. Lehman had about 60-80% bonuses this year and Morgan Stanley had about 45-55%. Except for Goldman, you are probably not going to get 100% bonus for a Java/C++ developer role from one of the other firms. So, I would take the 300K figure with a HUGE grain of salt, and look more at 210-225K as total comp.

With all of this said, my firm is also looking for top talent. If you have experience in the above areas, and if you want to explore some opportunities with us, please send your resume to me.


©2007 Marc Adler - All Rights Reserved

Saturday, January 20, 2007

96Bosses

While searching for some good interviewing questions for some candidates we have coming in (you are rolling your eyes at that one, but I swear that it's true!), I came upon this site, presumably created by the guy who wrote So You Want To Be a Wall Street Programmer .

Will all people who are applying to my group please *not* read this site, as I don't want you to see the questions that I am going to be asking you....

©2007 Marc Adler - All Rights Reserved

Python and FP on Wall Street???

One of the heads of a group that I deal with asked me about the use of Python on Wall Street. This group is strictly Windows.

Anyone reading this blog using IronPython? Any opinions? What are you doing with it?

Looks like Jane Street is using OCaml. Perhaps we should also be keeping our eyes on Microsoft's F#? Credit Suisse is investigating FP in one of their derivatives groups (FP through Excel).

©2007 Marc Adler - All Rights Reserved

How was your bonus this year?

Bonus season is upon us, and for the first time in my life, I have been part of it as a full-time employee.

When you are independent consultant, you view bonus season as some sort of other-worldly event, a day where the only people who are expected to work are the consultants. Now, when you are part of that world, you have to have to act as father, brother, priest, rabbi, drinking buddy, etc to fellow employees at various times throughout the day.

When I went into work that day, everyone was just standing around eachother's cubicles, nobody able to concentrate on anything. One division actually cancelled all meetings for the entire day. And, despite the exhortations to the employees to NOT discuss their compensation, you know that everyone knows what everyone else got.

Now comes the post-bonus season where the shuffling of chairs begins. I have already gotten calls from ex-colleagues inquiring into positions in my company. Let me give you some advice:

1) The grass always seems greener on the other side, but often isn't.

2) Did you deserve your bonus? Be your harshest critic.

3) Calm down for a day or two, and don't panic the second that you leave your manager's office.

4) Do you really want to work for Goldman? At this time of the year, there is a black hole at GS that resumes flow into. Look at quality of life. Do you want a job where your wife has to remind your kids of your name?

5) The Street is very very very small. Do not burn bridges!


So, how was your bonus?

©2007 Marc Adler - All Rights Reserved

Friday, January 19, 2007

Blood on the Streets

The New York Post reports layoffs on the trading floor.

©2007 Marc Adler - All Rights Reserved

Thursday, January 18, 2007

New Visualizations for Trading Systems

I am doing some thinking about new kinds of visual interfaces for trading systems. Whenever you walk through the trading floor, you see rows and rows of traders, each one having 6 monitors, each monitor containing a multiple array of grids of cells flashing in different colors. It takes a special kind of mentality to be able to navigate this extremely hypnotic array of lights 8 hours a day, 5 days a week, 52 weeks a year.

I came upon this thesis, written by one Pasha Roberts of MIT. This is probably the best summary of different visualization techniques being used for financial industries. Pasha also formed his own company, LinePlot, to take advantage of his thesis work.

The use of WPF for new kinds of visualizations is upon us. I have heard that several of the big investment banks are dipping their toes cautiously into the waters. The trick will be to come up with compelling visualizations without overpowering the user. Word is also that several IBs are recruiting game developers. In fact, the other day, there was a job posting on CraigsList for a hedge fund seeking to recruit a game developer.

I wonder if any of the CEP companies like StreamBase, Vhayu, Kaskad, etc have considered visualization schemes as output for the data it processes. It would be interesting for one of these engines to do some CEP and eventual transformation into a stream of XAML. I bet that Matt is thinking along these lines, maybe as an offshoot of his patented work at JPMC.


©2007 Marc Adler - All Rights Reserved

Thursday, January 04, 2007

New Book on Building Automated Trading Systems

I'm looking forward to this one ....


©2007 Marc Adler - All Rights Reserved

This is Patently Mad

Financial Services firms rushing to the patent office.

Details of a Goldman patent for reducing volatility. And this is the patent that Goldman just got for diddling.

What does this mean for small companies developing financial software? I know a few people developing new trading packages which they hope to sell. Hope you guys are engaging a patent attorney.

Whenever I came out with a new product through Magma Systems, the first thing I would do was to copyright the code. At that time, you needed to send the "first 100 and last 100 pages" of the souce code to the copyright office.

(thanks to Terry for the first link)


©2007 Marc Adler - All Rights Reserved

Coffee

Random thoughts ....

I have always wondered if there is any correlation between the coffee service that a company provides to the IT staff and the perceived quality of the company.

Barclays had the best coffee service. Being a British bank, it paid a lot of attention to the variety of teas it made available. It also had one of those big machines that made cappucino, expresso, or hot chocolate. I was at that machine five times a day.

BusinessEdge and Morgan Stanley have the little cups of Flavia coffee and hot chocolate ... totally free.

Wachovia in Charlotte ... never tried their coffee service ...in Charlotte, there are three Starbucks in every office building ... I never saw so many Starbucks per square meter.

My current company has free Martinson's coffee, but charges 50 or 75 cents for Flavia. After years of drinking Starbucks, Martinson's seems very bitter and flavorless. I guess that I am too used to Starbucks.

Do you bring in your own coffee machine? Watch it... many companies are cracking down on that practice.

How does your company's coffee culture stack up?


©2007 Marc Adler - All Rights Reserved

Monday, January 01, 2007

I Have Been BlogTagged

The newest fad in the blogsphere is "tag, you're it". DonXml tagged me, and now I have to tell you all five things about myself that you did not already know. I also have to tag five other people.

Ok, let me think ....

1) In high school, I played in a Progressive Rock copy band called Heresy. We performed songs by Gentle Giant, King Crimson, ELP, and others. The keyboard player was a rich kid from Baldwin, Long Island, who had every keyboard ever made.

2) I was a huge pro wrestling fan when I was a kid. I used to get ringside passes to the old Sunnyside Gardens in Queens, and take photos of wrestlers like Pedro Morales, Chief Jay Strongbow, Haystacks Calhoun, etc. I was also a writer for a little wrestling newsletter put out by a guy named David Meltzer ... now Meltzer is probably the best known journalist in pro wrestling.

3) In college, I was the winner of the annual concerto competition, and I played the Mayazumi Conceto for Marimba and Orchestra with the SUNY Albany Symphony Orchestra.

4) My father was good friends with Dave Kamansky. Dave was the ex-CEO of Merrill Lynch, and presided over Merrill in the go-go 90's. My father and Dave worked together in the Forest Hills branch of Merrill Lynch in the 70's, and Dave was part of my dad's pinochle group. So, every few weeks, Dave would come over to our apartment for the big pinochle game.

5) I was classmates with the actor, Tim Robbins. A better of acquaintance of mine was Stacey Nelkin, who was the female lead in Halloween III, and was a former girlfriend of Woody Allen.

Now, I need to tag 5 people. They will be:

Francis Shanahan

Chris Donnan

Matt Davey

John O'Sullivan

David Lattimore-Gay


©2007 Marc Adler - All Rights Reserved

Wednesday, December 27, 2006

Congrats to Chris

Chris is the new columnist for Automated Trader Magazine.

C'mon Chris .... when are you going to get that venture funding!

©2006 Marc Adler - All Rights Reserved

Tuesday, December 26, 2006

Penn-Lehman Automated Trading Project

Here

Plus, an internship at the Prop Trading group at Lehman.

Another reason to make sure that your kids study hard for the SATs.

©2006 Marc Adler - All Rights Reserved

News Mining Agent for Automated Stock Trading

Here is a thesis on semantic recognition of financial news items.

... as we slowly move towards phasing out traders (as per IBM's prediction).

©2006 Marc Adler - All Rights Reserved

Coding for Humanity

At this time of year, one's thoughts sometimes turn to the larger things in life. You might ask yourself what your legacy is going to be. Does your coding and architecture skills somehow contribute to the greater good of the world, and will humanity benefit from your efforts?

I never put this on my resume, but I consulted part-time for 4 1/2 years for a company called Classroom Inc. From January 1997 to October 2001, I would devote part of my time to writing "simulations" for CRI, and probably over one million school children have used my programs.

Classroom Inc (CRI) was originally formed as a non-profit partnership between IBM, JP Morgan, and Bear Stearns. Lewis Bernard, who was very high up at JPMC, was the CEO of Classroom Inc. The mission was to provide education computer software to inner-city and rural schools where the children could benefit from an "alternative learning experience".

Each one of the "simulations" was an interactive game, where the student was put in a certain life situation. For example, one simulation put you in the role of a bank manaer, while another one put you in the role as the CEO of a paper company. Each simulation consisted of 12 or 15 "chapters", where each chapter was devoted to a certain issue.

When I started consulting for CRI, each simulation went out to over 100,000 students, and by the time I finished up, each simulation reached more than 250,000 students.

The entire framework was written in MFC/C++. A lot of the internal design came from the old Macromedia Director, which was very popular at the time for creating interactive storyboards. A typical simulation took 6 to 8 months to write. The team consisted of a producer, 2 writers, 2 artists, a QA tester, and myself. Every few weeks, I would get a ZIP file in the mail consisting of the script for a new chapter, and all of the graphics, plus some haphazard directions for one or more "activities" that the kids would have to do in the chapter.

My involvement with CRI ended in 2001 when IBM, who was one of the partners, decided that they wanted to move to a new, internal Flash-based system, and wanted to end all C++ development. It took the IBM consultants quite a while to get the first simulation out there in Flash, but they finally managed to recreate all of the simulations and re-release them.

I was proud to have been a part of this effort for such a long time.

I was inspired to write this by a post that was on Joel on Software a few weeks ago. Joel talked about some cool new jobs that his jobsite was advertising, and one of the jobs dealt with medical technology, which is one of the noblest enterprises. Another worthy position is at DonorsChoice, which reminds me a bit of CRI.


©2006 Marc Adler - All Rights Reserved

Automatic Resource Refactoring Tool

Here

Move all of your hard-coded strings automatically into resource files.

©2006 Marc Adler - All Rights Reserved

Skyler Technology

Yet another entry in the time-series, object-cache, feed handler world ... Skyler Technology's C3 Database. This is definitely a hot area to be in right now, as Skyler, Vhayu, Streambase, etc all seem to be vying for a piece of the pie.

Skyler has a nice use case for order book management.



©2006 Marc Adler - All Rights Reserved

Saturday, December 09, 2006

DevExpress XtraPivotGridSuite

Recommended by a colleague who is very interested in OLAP tools....

How long before Infragistics comes up with something similar?


©2006 Marc Adler - All Rights Reserved

OLAP/Analysis Services

Had a very interesting presentation from Microsoft on Analysis Services and OLAP.

What are traders and risk managers using OLAP for at your bank?

Any experience using OLAP is a real-time scenario to perform up-to-the-second reporting? Our feeling is that OLAP cannot be used successfully in a real-time environment unless you have very small cubes.

©2006 Marc Adler - All Rights Reserved

Wednesday, December 06, 2006

FPG911

Brilliant quote from a colleague:

If you need time off from work to test-drive a Porsche, just tell your boss that you are investigating hardware acceleration.

©2006 Marc Adler - All Rights Reserved

Less Reliance on Vendors

Even though there are a lot of things to be desired about working at Morgan Stanley, I must say that they have got the right idea about lessening their reliance on vendors. Their EIA group has their own XML-based pub/sub message bus (CPS), their own market data infrastructure (Filter), their own .NET client-side framework, and more. What they have done is cut companies like Tibco out of the loop, and are no longer beholden to vendor release cycles, upgrade fees, and huge licensing costs. Morgan owns the source, and has the staff to maintain and enhace their IP. In fact, a friend of mine at Morgan told me that, if they wanted to, Morgan could take CPS and give Tibco a run for their money.

©2006 Marc Adler - All Rights Reserved

Sunday, December 03, 2006

CAB, EventBroker, and Wildcards

I will be blogging about the CAB EventBroker soon. But, I think that I like mine (previously published here) better. I would like to see wildcard support in the EventBroker's subscription strings.

In CAB, you can define an event to be published like this:

[EventPublication("event://Trade/Update", PublicationScope.Global)]
public event EventHandler TradeUpdated;

........

public void TradeIsUpdated(Trade trade)
{
if (this.TradeUpdated != null)
{
this.TradeUpdated(this, new InstrumentUpdatedEventArgs(trade));
}
}

In some other module, you can subscribe to an event like this:

[EventSubscription("event://Trade/Update")
public void OnTradeUpdated(object sender, InstrumentUpdatedEventArgs e)
{
}

I need wildcards. I might like to have a function that gets called when any operation happens to a Trade object. So, I would like to see subscription topics like these:

"event://Trade/*"

or

"event://Trade

Both of these would cover the case when any operation happens to a trade. The subscription string would catch the following topic:

event://Trade/Updated
event://Trade/Deleted
event://Trade/Created

I need Tibco-lite as my internal message bus.

©2006 Marc Adler - All Rights Reserved

Saturday, December 02, 2006

CAB and Status Bars?

I have not gotten into the Smart Client Factory yet (preferring to learn the underlying CAB framework), so this question might be answered by the SCSF .... but has anyone made a UIExtensionSite for a statusbar object yet?

©2006 Marc Adler - All Rights Reserved

Grid Computing and UBS

Grid computing webcast here, featuring people from UBS, Microsoft and Digipede.

Our head quant tells us that UBS has an internal website that can price exotics amazingly fast. Something that all of us can strive for...

©2006 Marc Adler - All Rights Reserved

Microsoft Single Point of Contact

Microsoft DPE and MCS need to read this

©2006 Marc Adler - All Rights Reserved

Thursday, November 30, 2006

CAB and WorkItems

WorkItems

A WorkItem is considered to represent a “use case” in CAB terminology. Ignore this. It is really just a container of other kinds of objects along with some state information.

A CAB application has a tree of WorkItems. The main CabApplication class contains a reference to the root WorkItem, which is referred to by the RootWorkItem property. Given a WorkItem, you can go up one level to its ParentWorkItem, or down to the next level by accessing the workItem.WorkItems collection.

Recall that the main application class is defined like this:

class CABQuoteViewerApplication : FormShellApplication

The first argument in the generic’s argument list is the type of WorkItem that will be the RootWorkItem of our entire application. All other WorkItems will be descendants of this RootWorkItem. A WorkItem has access to any of its descendant’s properties; however, sibling WorkItems cannot access eachother’s properties directly.

A WorkItem also contains various other collections. It has collections of:

  • Workspaces
  • SmartParts
  • Commands
  • EventTopics
  • Services
  • Items (you can stick any object in this collection, including state, views, etc)
A WorkItem can contain a State. This is a named collection of name/value pairs. Events are fired when a value in the State changes. When a WorkItem is saved, its State is saved along with it.

You can Activate/Deactivate a WorkItem, Terminate it, and persist it (Save and Load).

There is a virtual function called OnRunStarted() that you can override in order to create views, read data, etc.



WorkItemExtensions

A WorkItemExtension is a way of extending the behavior of a WorkItem without having to change the WorkItem’s code nor resorting to subclassing the WorkItem. It is a class that just receives certain events that happen to the associated WorkItem. These events are:

Initialized
RunStarted
Activated
Deactivated
Terminated

To extend a WorkItem, you need to create a new subclass of WorkItemExtension. Then you need to create an object of that class; this object is associated with an underlying WorkItem. Then you just handle certain events that happen to the WorkItem.




public class QuoteViewWorkItemExtension : WorkItemExtension
{
public QuoteViewWorkItemExtension() {}

protected override OnActivated()
{
PerformanceTimer.StartPerformanceTiming();
}

protected override OnDeactivated()
{
PerformanceTimer.StopPerformanceTiming();
}
}


And, to use this new WorkItemExtension, you would do the following:


QuoteViewWorkItemExtension wix = new QuoteViewWorkItemExtension();
Wix.Initialize(myWorkItem);
This concept is very much akin to the “advice” that AOP containers like Spring.Net provide for you, except that you do not have any runtime code injection.

©2006 Marc Adler - All Rights Reserved

CAB and Workspaces

Workspaces

You might be familiar with various kinds of layout managers that automatically arrange the windows that the manager contains. If you are a Java developer, you might be used to layout managers like the FlowLayout manager and the GridLayout manager. The layout manager works in conjunction with a container. The container holds the controls, and the layout manager positions and sizes the controls as they are added to the container.

In CAB, we have Workspaces and SmartParts. A Workspace is a container for holding SmartParts. A WorkItem contains a list of zero or more Workspaces, so you can have workspaces within workspaces.

Most CAB applications will need to create a root Workspace within the main form.

The different kinds of Workspaces in CAB are:

  • WindowWorkspace
    Vanilla area for holding SmartParts
    For an MdiWorkspace, will automatically create a Form to hold a SmartPart
  • DeckWorkspace
    Stacks SmartParts in an overlapping manner
  • MdiWorkspace
    Regular MDI container, derives from WindowWorkspace
  • TabWorkspace
    Tabbed Windows
  • ZoneWorkspace
    Allows tiling of window areas, good for implementing an Outlook type layout


There are two ways of adding zones. One is to use the Visual Studio .Net designer, and drag a workspace from the Toolbox onto a form.




The other way is to dynamically create the workspace in the FormShellApplication’s AfterShellCreate() override.

Here is an example of creating various types of workspaces using the second method (the code is “unwound” for the sake of this article):




using System;
using System.Windows.Forms;
using CABQuoteViewer.WorkItems;
using Microsoft.Practices.CompositeUI.SmartParts;
using Microsoft.Practices.CompositeUI.WinForms;

namespace CABQuoteViewer
{
class CABQuoteViewerApplication : FormShellApplication<QuoteViewerWorkItem, MainForm>
{
private IWorkspace m_workspace;
private QuoteViewerWorkItemExtension m_quoteWorkItemExt;

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
new CABQuoteViewerApplication().Run();
}

protected override void BeforeShellCreated()
{
base.BeforeShellCreated();

if (this.RootWorkItem != null)
{
this.m_quoteWorkItemExt = new QuoteViewerWorkItemExtension();
this.m_quoteWorkItemExt.Initialize(this.RootWorkItem);
}
}

protected override void AfterShellCreated()
{
base.AfterShellCreated();
this.CreateWorkspace("Deck");
}

private void CreateWorkspace(string wsTypeName)
{
if (wsTypeName == "Mdi")
{
this.m_workspace = new MdiWorkspace(this.Shell);
this.RootWorkItem.Workspaces.Add(this.m_workspace, "ClientWorkspace");
}
else if (wsTypeName == "Tab")
{
this.m_workspace = this.RootWorkItem.Workspaces.AddNew<TabWorkspace>("ClientWorkspace");

TabWorkspace tabWorkspace = this.m_workspace as TabWorkspace;
tabWorkspace.Dock = DockStyle.Fill;
this.Shell.Controls.Add(tabWorkspace);
}
else if (wsTypeName == "Deck")
{
this.m_workspace = this.RootWorkItem.Workspaces.AddNew<DeckWorkspace>("ClientWorkspace");

DeckWorkspace deckWorkspace = this.m_workspace as DeckWorkspace;
deckWorkspace.Dock = DockStyle.Fill;
this.Shell.Controls.Add(deckWorkspace);
}
else if (wsTypeName == "Zone")
{
this.m_workspace = this.RootWorkItem.Workspaces.AddNew<ZoneWorkspace>("ClientWorkspace");

ZoneWorkspace zoneWorkspace = this.m_workspace as ZoneWorkspace;
zoneWorkspace.Dock = DockStyle.Fill;
this.Shell.Controls.Add(zoneWorkspace);
}
else
{
throw new Exception("Cannot create workspace");
}
}
}
}


When you add a SmartPart to a Workspace, you can pass along hints that tell the Workspace how to layout and decorate the SmartPart. The Workspace class has functions for
  • Showing a SmartPart (which also adds the SmartPart to the Workspace as well)
  • Hiding a SmartPart
  • Activating a SmartPart
  • Closing a SmartPart

There are events that get fired when a SmartPart is activated within a Workspace, and when a SmartPart is closing within a Workspace.

You can create new, custom workspaces in CAB, and a later article will cover this.



©2006 Marc Adler - All Rights Reserved

The CAB Application Class Hierarchy

CAB Application Classes

The hierarchy of the CABApplication classes is shown in the diagram below. The top three classes should never be derived from. In almost all classes, your WinForms-based application will derive from FormShellApplication.





A CAB Application will be driven by the base CabApplication class. This class does most of the work to get the CAB application started.

The only field that the CabApplication class has is the root WorkItem, which as the name implies, is the root node of the entire application’s WorkItem tree. I will discuss WorkItems later.

The constructor of CabApplication does nothing; it is the Run() method (which is called by your application’s Main() function) that bootstraps the entire application. The Run() method will do the following:

  • Create the pre-defined services
  • Authenticate the user.
  • Reads the config file (ProfileCatalog.xml) that contains a list all of the plug-in modules that the app wants to load.
    Each module can have an optional list of Roles. The module will be loaded only if the current user belongs to that role. If a module has no role information associated with it, then the module will be loaded.
  • Creates the Shell (ie: the MainForm)
  • Loads all of the modules that are permitted to be loaded.
    In each class in the module that derived from the ModuleInit class, all fields that are tagged with the [ServiceDependency] attribute are created.
    All classes tagged with the [Service] attribute are added to the application’s list of services.
  • RootWorkItem.Run() is called for the applications root WorkItem.
  • In the FormShellApplication class, the WinForm’s method Application.Run() is called to start the WinForm app.


The Derived Application Classes

The CabShellApplication class extends the CabApplication by
  • Keeping a reference to the Shell (our MainForm) by adding it to the RootWorkItem’s list of items.
  • Adding BeforeShellCreated and AfterShellCreated virtual methods. These methods can be overridden in your application class.
The WindowsFormApplication extends the CabShellApplication class by
  • Using a WindowsForm Visualizer

  • Adding some UI and command-routine services



The FormShellApplication class merely overrides the Start() method and calls the familiar WinForms method Application.Run(mainform).


©2006 Marc Adler - All Rights Reserved

A Minimal CAB Application

First CAB Application

1) Create a new Windows Form Application solution named CABQuoteViewer.
a. Change the name of the form to MainForm.

2) Add the existing CAB projects to the solution.
a. Browse to C:\Program Files\Microsoft Composite UI App Block\CSharp\Source

b. Add the existing projects for ObjectBuilder, CompositeUI, and CompositeUI.WinForms.

c. In the CABQuoteViewer project, add references to the above 3 projects.

3) Rename the file Program.cs to CABQuoteViewerApplication.cs

4) In the file CABQuoteViewerApplication.cs,
a. Add references to the CAB namespace
using Microsoft.Practices.CompositeUI;
using Microsoft.Practices.CompositeUI.WinForms;

b. Change the definition of the class from
static class Program
to
class QuoteViewerApplication : FormShellApplication

c. The body of the Main() function should just be
new QuoteViewerApplication().Run();


The final version of CABQuoteViewerApplication.cs is:

using System;
using Microsoft.Practices.CompositeUI;
using Microsoft.Practices.CompositeUI.WinForms;

namespace CABQuoteViewer
{
class CABQuoteViewerApplication : FormShellApplication
{
[STAThread]
static void Main()
{
new CABQuoteViewerApplication().Run();
}
}
}

After compiling and running this application, you will see the empty MainForm appear.

©2006 Marc Adler - All Rights Reserved

Tuesday, November 28, 2006

Getting Started with CAB

It looks like, for various reasons that shall accompany me to the grave, we will be bootstrapping the "top part" of our client-side framework with Microsoft's Composite Application Block. I am excited to finally be given the chance to learn CAB, and to lead the team doing the new client-side framework for my investment bank.

I will try to document my learning process with CAB so that I can save my successors some pain.


Installation of CAB and Accessories

Download and install the following files in order (make sure to install GAX before installing GAT):

1) Download Composite Application Block for C# (CAB)
2) Download Enterprise Library 2006 (EntLib)
3) Download the Guidance Automation Extensions (GAX)
4) Download the Guidance Automation Toolkit (GAT)
(At this point, before installing the Smart Client Software Factory, you must build CAB using the CompositeUI.sln solution file located in the directory C:\Program Files\Microsoft Composite UI App Block\CSharp. You must also close Visual Studio before installing SCSF.)
5) Download the Smart Client Software Factory (June 2006 version) (SCSF)
6) Download the CAB Hands-on Lab
7) Download the Intro to CAB document and the CAB help files (you might want to create shortcuts on the desktop for these files.)
8) Download the Sample Visualizations

If you have problems uninstalling GAX or GAT, read this.


Resources

· The CAB home on Microsoft Patterns and Practices area on GotDotNet
· CabPedia
· MSDN Magazine Article
· Getting Started with CAB on the Fear and Loathing blog
· Understanding CAB series on Szymon’s blog


Class Hierarchy

Here is a diagram of the major classes in CAB:




©2006 Marc Adler - All Rights Reserved

Monday, November 27, 2006

Free Market Data

Free ECN real-time data from OpenTick.

Very cheap ($1) monthly fees for some other data.

They have APIs in various languages, including C# for .Net 2.0. This seems like a good way to test that async data handling part of a framework. Here is some example docs for one of their calbacks:

static void onQuote(OTQuote quote)
Description
Provides real-time and historical quotes.
Provides
OTQuote


©2006 Marc Adler - All Rights Reserved

Eclipse Trader

A colleague pointed out the open-source Eclipse Trader, built upon the Eclipse Rich Client Platform (RCP).

There exists people in my company whose number > 1 who would be most pleased if I would fully embrace Eclipse RCP.

©2006 Marc Adler - All Rights Reserved

Downloading Yahoo Quotes

Here is a great page for composing URLs to get all sort of delayed quote data from Yahoo

©2006 Marc Adler - All Rights Reserved

Saturday, November 25, 2006

Coderific

Ratings for Coders, by the Coders.

©2006 Marc Adler - All Rights Reserved

Windows Shutdown Crapfest

Via Joel, there is required reading on Microsoft here.

I am currently involved with Microsoft's MCS and DPE in my job. I know that many of the people that I interact with are fervent readers of both Joel and of Mini-Microsoft, and that they will eventually read the above-mentioned article.

What has happened to my beloved Microsoft? Thank the lord that we are engaging some of the most talented Microsoft partners on the planet.

©2006 Marc Adler - All Rights Reserved

Friday, November 24, 2006

Object Cache Considerations (Part 3)

Distribution and Subscriptions

An out-of-process object cache should not only have a storage component, but a messaging system as well. One of the architects in my group, who is a well-known messaging guru, told me that the ideal object cache should have a state-of-the-art messaging system attached to it.

Our object caches should be distributed and subscribable.

A logical cache can be distributed amongst several different servers. We can do this for load balancing and for failover. Applications also have local caches that communicate with the master, distributed cache(s).

Let's say that we are storing information about each position that our company maintains. We might want to have 3 distributed caches, one that stores positions for our customers in the US, one for customers in Europe and the Middle East/Africa, and one for Asia. Upon startup, the master cache loader will read all of the positions from the database and will populate each of the three caches.

This is an example of a very simple load balancer for the distributed caches. Other load balancing schemes include partitioning the positions by the first digit of the position id, a date range, etc.

Each application that uses positions will have its own local cache. These local caches will usually contain a subset of the data that is in the master caches. For example, the US Derivatives Desk might just need to cache positions from US portfolios that have been active in the last 30 days.

When an application updates or deletes a position in one of the master caches, we need to update all of the other master caches that we are using for failover purposes, and any other master caches that contain that particular position. Similarly, when we create a new position, we need to propagate that new position to any redundant caches or any caches that might be interested in the new position.

We might need to push the new or updated position to any of the local caches that are interested in that position. We have a choice of architecture for distributing updates to local caches.
1) We do not distribute the updated object at all. An application won’t know that there is new data in the master cache until it retrieves that object again.
2) We push the update to the local caches right away. We can push out full objects or just the deltas (changes to the object).

There are disadvantages of both schemes. Under scheme (1), the application could be working with old data. Under scheme (2), we could be updating an object in the local cache while the application is working on that same object. Also, under scheme (2), we now have to worry about messaging more.

The master caches have to have some way of communicating with the local caches. We can communicate with each application by one of the familiar messaging mechanisms; Tibco EMS, Tibco RV, LBM, Sockets, etc.

We need to make sure that the messaging is reliable. Each subscriber must receive the update of the object from the master cache. There is no tolerance for dropped messages. Otherwise, different applications might be working with different versions of an object.

We do not have to make the message durable. In other words, if a client goes offline for a while, then the messaging part of the cache does not have to save the update until a time where that client decided to reconnect. So, this saves us the need of storing out-of-date messages.

Using a JMS-based messaging scheme also means that we can use JMS Selectors to filter out objects that an application is not interested in. Selectors have overhead with them, but it is easy to set up a filter-based pub/sub mechanism between the master caches and any local caches. For example, one application might only be interested in updates to position objects whose position id starts with the prefix “A23”. It is easy to set up a JMS selector that has the pattern “positioned LIKE ‘A23%’”.

©2006 Marc Adler - All Rights Reserved

Sunday, November 19, 2006

So long Mike

Our friend Mike was a 25-year veteran of the Financial Service practice of a very large consulting firm. He was just informed that he was to be dismissed, on the basis of not making his (unrealistic) sales quota. The new management of the division and Mike did not agree on things, and the easy way to get rid of a person is to set him up for failure.

Mike will easily find a new position, as he is known and respected in the financial services area. And, opportunity is also borne out of adversity.

Know the warning signs when you are being set up to fail. Miike saw them a mile away, and was prepared.

©2006 Marc Adler - All Rights Reserved

SQl Server 2005 Performance Tips

Here

Good performance hints if you are doing a lot of OLTP processing. Most of the tips will work for Sybase as well.

It is remarkable what performance improvements you can make in an OLTP system if you hire a true database tuning expert to go over your systems with a fine-tooted comb. Unfortunately, the tuning does not usually extend into refactoring the data model. This is because a lot of apps touch the databases, and you would then have to go in and start refactoring app code.

SQL Server 2005 comes with new, easy-to-use profiling tools, and I encourage you to take advantage of them as you are developing new apps. If you are a dev manager, try to get funding for two weeks of a SQL Server 2005 expert's time once your data model is written.

In addition, try to get your SANs tuned correctly, and optimize the interaction between frequenty-used database indexes and the spindles.

How about hardware acceleration, like Solid State Disks?

Kudos go out to this site, completely devoted to SQL Server performance tuning.

Final word - if you have a mission-critical application that involves heavy database access, spend the bucks and hire a DB architect who knows how to tune databases like a 1964 Fender Strat.


©2006 Marc Adler - All Rights Reserved

Sunday, November 12, 2006

Saudi Stock Market Collapse

I had no idea that this was going on....

©2006 Marc Adler - All Rights Reserved

Object Cache Considerations (Part 2)

Object Versioning

You can consider the ‘version’ of an object to be two different things.

In the first case, the ‘version’ of an object could represent the number of times a particular object has been written to. When an object is first created, its version number is set to 1, and then each time a client updates the object, the version number is increased. So, we can have an API call is our object cache that tests to see if we are holding on to the most recent version:

if (!ObjectCache.IsCurrent(object))
object = ObjectCache.Get(object.Key);

or, if we are using a object that has a proxy to the cache, we can do something like this:

if (!object.IsCurrent())
object.Refresh();


In the second (and substantially more complex) case, the ‘version’ can represent the actual layout or shape of an object’s class. Consider a Trade object:

public class Trade : CachedObject
{
public int SecurityId;
public double Price;
}

This would be version 1.0 of the class.

Let’s say that we have a trading system that has to run 24x7, as is the current rage. Systems that run 24x7 theoretically have no chance to be bounced. Even a system that runs 24x6.5 has a window for maintenance. Our trading system has version 1.0 of the Trade object.

Now let’s say that we have a request to add sales attribution to the trading system, so now we need to add the id of the sales trader that took the trade request.

public class Trade : CachedObject
{
public int SecurityId;
public double Price;
public int BrokerId;
}

This is now version 1.1 of the class.

Our object cache holds version 1.0 objects, and all of our subscribers also hold version 1.0 objects. But, now let’s say that the system that writes new trades into the object cache now has to write version 1.1 objects. What do we do?

There are several things to consider here. How do we represent the object in the cache? Because we are using name/value pairs, all new objects will just have the BrokerId/ field added. The old 1.0 objects that are in the cache do not have to change.

The object cache might want to broadcast a message to all subscribers, telling them that the version number of the Trade object has changed. Since the subscribers may be systems that must run 24x7, then the systems might not be able to be bounced in order to rebuild their trade caches. The systems must be able to read and write the new version 1.1 objects as well as continue to support the older 1.0 objects. But, we cannot reconfigure the layout of the objects dynamically, can we?

Instead of using C# objects, we might consider using dictionaries of dictionaries to represent an app’s object cache. But this is a different kind of programming model. Instead of coding:

Trade obj = ObjectCache.Get(“102374”);
int broker = obj.BrokerId;

We might have to do the following (taking advantage of C# 2.0’s nullable types) :

TradeDictionaryObject obj = ObjectCache.Get(“1002374”);
int? broker = obj.GetInt(“BrokerId”);

What a mess!

What does this tell us? When using an object cache for a 24x7 system, make sure you get your class definition right the first time, and avoid object versioning!

©2006 Marc Adler - All Rights Reserved

Considerations for an Object Cache (Part 1)

Let’s say that we wanted to write our own multi-platform, distributed, subscription-based object cache. What would we need to do to write the ultimate object cache?

Let’s consider a variety of issues that we would have to consider when writing caching middleware. I am sure that vendors like Gemstone have gone through this exercise already, but why not go through it again!

Multiplatform support

Most Investment Banks have a combination of C++ (both Win32 and Unix), C#/.Net and Java (both Win32 and Unix) applications. It is common to have a .Net front-end talking to a Java server, which in turn, communicates to a C++-based pricing engine. We need to be able to represent the object data is some sort of form that can be easily accessed by applications in all of the various platforms.

The most universal representation would be to represent the object as pure text, and to send it across the wire as text. What kind of text representation would we use?

XML – quasi-universal. We would have to ensure that XML written by one system is readable by other systems. XML serialization is well-known between Java and C# apps, but what about older C++ apps. For C++, would we use Xerces? Also, there is the cost of serialization and deserialization, not to mention the amount of data that is sent over the wire.

Name/Values Pairs – easy to generate and parse. Same costs as XML. We would have to write our own serialization and deserialization schemes for each system. How about complex, hierarchical data? Can simple name/value pairs represent complex data efficiently? Or would we just end up rewriting the XML spec?

Instead of text, we can store objects as true binary objects. What kind of binary object do we store? Native or system-agnostic? If you have a variety of platforms writing into the object cache, do we store the object in the binary format of the system that created the object, or do we pick one platform and use that as master?

Master Format – We pick one format, either C++, C#, or Java binary objects. We would need a series of adapters to transform between binary formats. We would also need an indication of the platform that is doing the reading or writing. Let’s say that we were to store all objects as binary Java objects. If a Java app reads an object, then there would be no costs associated with object transformation, so we can just send a binary Java object down the wire (although we may have to worry about differences between the various versions of Java … can a Java 1.5 object with Java 1.5-specific types or classes be read by a Java 1.4 app?). If a C# app wants to read the Java object, then we must perform some translation. (Do we use something like CodeMesh to do this?) We also need to ensure that the adaptors can support all of the features of the various languages. For example, let’s say that Java came up with a new data type that C# did not support … would we try to find some representation of that type in C#, or would we just not translate that particular data type?

Native Format – We store pure binary objects, without regards to the system that is reading or writing the object. There is no translation layer. Apps are responsible for doing translation themselves. This is the fastest, most efficient way of storing objects. However, different teams might end up writing their own versions of the translation layer.

What other factors might we consider when choosing a native object format?

How about deltas in subscriptions? If we are storing large objects, then we might only want to broadcast changes to the object instead of resending the entire object. Delta transmission favors sending the changes out in text, and we can save the cost of translating the binary into text if we were just to store the objects as text. And, in this case, name/value pairs are favored.

Large sets of name/value pairs can be compressed if necessary, but we have to consider the time needed to compress and decompress.

Can our object cache store both text and binary? Sure, why not. We can tag a cache region as supporting binary or text, and have appropriate plugins for various operations on each.

As always, comments are welcome.

©2006 Marc Adler - All Rights Reserved