If you are a fan of guitar, blues or just plain old great music, check this out.
I am not a guitarist nor do I really like the blues, but like everyone else who saw this on YouTube, it hit me in the right place. I actually saw Roy years ago when a school chum got tickets to a taping of ABC's In Concert TV Series. The bill was Uriah Heep, Roy, The Persuasions, and Savoy Brown. Roy blew everyone away.
I continue to be astounded by the things I find on YouTube. My YouTube id is VanderTop2, so you can browse my Favorites list and see what kind of things I am unearthing.
©2006 Marc Adler - All Rights Reserved
Friday, September 08, 2006
Thursday, September 07, 2006
Celllllllllebration, Yeah, Come On!
We have been given the go-ahead for the .NET Client Framework!
Thanks to all who contributed ideas, both publicly and privately. And thanks to various open-minded individuals at my IB.
My ex-colleague, Chris, will be embarking on an effort to do the same at another IB. Will it be Service Locator vs Spring.Net? Stay tuned!
Beers are on me.....
©2006 Marc Adler - All Rights Reserved
Thanks to all who contributed ideas, both publicly and privately. And thanks to various open-minded individuals at my IB.
My ex-colleague, Chris, will be embarking on an effort to do the same at another IB. Will it be Service Locator vs Spring.Net? Stay tuned!
Beers are on me.....
©2006 Marc Adler - All Rights Reserved
Sunday, September 03, 2006
Thoughts on Performance in Trading Systems and .NET
Rico has done it again with a post that provides much thought.
With the advent of object oriented languages (C++), and higher-level languages (C#, Java), most developers try to craft elegant, object-oriented frameworks, complete with reflection, heavyweight classes, lots of properties. I am one of these.
However, I remember the days where I had to cram all of the functionality of New York Word (my very first commercial product) into 512K of ram. Pouring over code, trying to see if I can save a few bytes here and a few bytes there. Looking at the output of the Microsoft Linker to see if I can save space. Looking over the disassembly of a crucial module, such as the one that performed wordwrapping.
In the next few years, we are going to start seeing a predicted rate of 456,000 messages per second from some of the market data feeds. The goal is to get these messages, transformed into viable data, into another, trader-facing system, with as little delay as possible. There are additional needs to get this data into algorithmic trading systems and black-box trading systems with the lowest possible latency. The time taken to serialize and deserialize data, construct objects, and perform garbage collection can mean a precious few milliseconds added onto the path that your data takes. If you are writing array-handling code in a managed environment, then the time it takes to perform array checking might add further delay. Even the slightest delay can mean millions of dollars in lost opportunities.
An incredible amount of effort has been spent in writing high-performance, low latency graphics toolkits for rendering objects in video games. Has similar efforts been made to "render" the flow of market data, where every market tick counts?
I would love to hear about any experiences that you have had in getting market data into a client as fast as possible. Things like compressing data, conflating data, choice of transport, choice of GUI grids, high-performance threading, etc.
Microsoft has oodles of articles that deal with performance in .NET. I am anxious to see any performance improvements throughout the entire .NET stack. I am also interested to see how .NET/C#/C++ stacks up against a similar Java/Linux stack, given the same hardware. The PetShop demo might work well for a typical developer, but for trading systems developers, we need to see something a bit more substantial.
©2006 Marc Adler - All Rights Reserved
With the advent of object oriented languages (C++), and higher-level languages (C#, Java), most developers try to craft elegant, object-oriented frameworks, complete with reflection, heavyweight classes, lots of properties. I am one of these.
However, I remember the days where I had to cram all of the functionality of New York Word (my very first commercial product) into 512K of ram. Pouring over code, trying to see if I can save a few bytes here and a few bytes there. Looking at the output of the Microsoft Linker to see if I can save space. Looking over the disassembly of a crucial module, such as the one that performed wordwrapping.
In the next few years, we are going to start seeing a predicted rate of 456,000 messages per second from some of the market data feeds. The goal is to get these messages, transformed into viable data, into another, trader-facing system, with as little delay as possible. There are additional needs to get this data into algorithmic trading systems and black-box trading systems with the lowest possible latency. The time taken to serialize and deserialize data, construct objects, and perform garbage collection can mean a precious few milliseconds added onto the path that your data takes. If you are writing array-handling code in a managed environment, then the time it takes to perform array checking might add further delay. Even the slightest delay can mean millions of dollars in lost opportunities.
An incredible amount of effort has been spent in writing high-performance, low latency graphics toolkits for rendering objects in video games. Has similar efforts been made to "render" the flow of market data, where every market tick counts?
I would love to hear about any experiences that you have had in getting market data into a client as fast as possible. Things like compressing data, conflating data, choice of transport, choice of GUI grids, high-performance threading, etc.
Microsoft has oodles of articles that deal with performance in .NET. I am anxious to see any performance improvements throughout the entire .NET stack. I am also interested to see how .NET/C#/C++ stacks up against a similar Java/Linux stack, given the same hardware. The PetShop demo might work well for a typical developer, but for trading systems developers, we need to see something a bit more substantial.
©2006 Marc Adler - All Rights Reserved
On the Beach
I have been trying to fly out to a beach for the past few weeks, but every time I reserve a plane, the weather craps out. Had a plane reserved for today, but we have the remnants of Hurricane Ernesto. It is supposed to be an amazing day tomorrow, so I will try to make Ocean City, NJ.
There are a few beaches on the East Coast that you can fly to. Our favorite is Block Island, Rhode Island, right off the eastern tip of Long Island and about 1h15m from MMU. Block Island is only reachable by ferry, and hence, the beaches are relatively less crowded than your typical East Coast beach.
Other beaches that have airports within walking distance include Provincetown (Mass), Ocean City (NJ), Katana (Martha's Vineyard).
©2006 Marc Adler - All Rights Reserved
There are a few beaches on the East Coast that you can fly to. Our favorite is Block Island, Rhode Island, right off the eastern tip of Long Island and about 1h15m from MMU. Block Island is only reachable by ferry, and hence, the beaches are relatively less crowded than your typical East Coast beach.
Other beaches that have airports within walking distance include Provincetown (Mass), Ocean City (NJ), Katana (Martha's Vineyard).
©2006 Marc Adler - All Rights Reserved
Market Data Tech Conf - NYC - Sept 28,29 2006
Hope Craig sees this one.
We should have more fans of Market Data where I work, seeing how Craig kept everyone until after 5PM on the Friday before Labor Day with an amazing lecture on Market Data.
In the past, I have just built trader workstations that merely hooked up to a market data feed through some sort of communication mechanism (sockets, Tibco RV, EMS) without having to be concerned about the ins-and-outs of the data. However, Craig has been doing market data for 15 years, and it's a pleasure to work along someone who is so passionate about the area.
©2006 Marc Adler - All Rights Reserved
We should have more fans of Market Data where I work, seeing how Craig kept everyone until after 5PM on the Friday before Labor Day with an amazing lecture on Market Data.
In the past, I have just built trader workstations that merely hooked up to a market data feed through some sort of communication mechanism (sockets, Tibco RV, EMS) without having to be concerned about the ins-and-outs of the data. However, Craig has been doing market data for 15 years, and it's a pleasure to work along someone who is so passionate about the area.
©2006 Marc Adler - All Rights Reserved
Investment and Trading System Documentation Project
While browsing through the FIX forums, I saw mention of an effort called the Investment and Trading System Documentation Project. Interesting idea, but it looks as if it really never got off the ground. Still, they have a repository of some articles on Electronic Trading.
©2006 Marc Adler - All Rights Reserved
©2006 Marc Adler - All Rights Reserved
Wednesday, August 30, 2006
The Bronx Cheers
Random Seinfeld-ish Thought...
Why are Americans suddenly using the signatory line of "Cheers"? People I know who were born and raised in Brooklyn are suddenly signing email message with "Cheers".
The next time you say "Cheers" to me, you had better have a scotch in your hand!
©2006 Marc Adler - All Rights Reserved
Why are Americans suddenly using the signatory line of "Cheers"? People I know who were born and raised in Brooklyn are suddenly signing email message with "Cheers".
The next time you say "Cheers" to me, you had better have a scotch in your hand!
©2006 Marc Adler - All Rights Reserved
Monday, August 28, 2006
Pair Programming and Market Data?
I was talking about Agile/Scrum with our head of market data systems. He advised me that, with regards to Pair Programming, if you have two sets of eyes looking at a computer at the same time, then the exchanges would consider this grounds for charging double for the market data!
OK, Messrs Fowler, Beck, and Schwaber! What do you have to say about that!
©2006 Marc Adler - All Rights Reserved
OK, Messrs Fowler, Beck, and Schwaber! What do you have to say about that!
©2006 Marc Adler - All Rights Reserved
Sunday, August 27, 2006
Java vs C#/.NET in Investment Banks
Although there are definite pockets of .NET development in most investment banks on Wall Street, the majority of the development efforts are still in Java, especially on the server side. This is nowhere more apparent than in the investment bank that I am currently working for.
I am becoming more and more impressed with the Open Software that has been developed for the Java community, and the I have been similarly impressed with the sense of comradery that the Java community has. Most of the interesting .NET tools have origins in the Java world (NUnit, Spring, Hibernate, etc).
One of my tasks in my current position is to look at what our company has in terms of client-side frameworks and to come up with a proposal for a company-wide framework. This means looking at the toolkits that various groups are using or currently developing, looking at what I have done in the past, and making some recommendations by taking the best-of-breed of the various efforts. In addition to looking at .NET frameworks, I have been asked to look at some of the Java frameworks. And, I have been impressed by some of the Java efforts.
Some people have even asked me to look at things like Eclipse RCP and the NetBeans RCP. Several of my colleagues have blogged in the past about the viability of Eclpise RCP as a client-side framework. I feel that I need to take a serious look at it.
You all know that I have been a staunch advocate of .NET in the past. However, I am finding it more difficult to beat back the Java supporters. Some of the arguments that I have used against Java in the past (slowness, not as nice a UI, etc) have been colored by my past experiences with AWT, Swing, and JFC. But, Java GUI development has definitely evolved.
I would love to hear from my blog readers as to why I should continue to push .NET over Java.
Some reasons that I can think of for preferring .NET over Java:
1) I feel C# is a stronger language, and will continue to evolve into an even more powerful entity.
2) Closeness of .NET to the O/S, especially when Vista comes out.
3) Support for .NET inside of SQL Server 2005.
4) Possible business reasons are Microsoft non-support of a JVM and the precarious nature of Sun's balance sheet.
5) Better integrations with the standards in desktop tools (Excel, Word, etc)
©2006 Marc Adler - All Rights Reserved
I am becoming more and more impressed with the Open Software that has been developed for the Java community, and the I have been similarly impressed with the sense of comradery that the Java community has. Most of the interesting .NET tools have origins in the Java world (NUnit, Spring, Hibernate, etc).
One of my tasks in my current position is to look at what our company has in terms of client-side frameworks and to come up with a proposal for a company-wide framework. This means looking at the toolkits that various groups are using or currently developing, looking at what I have done in the past, and making some recommendations by taking the best-of-breed of the various efforts. In addition to looking at .NET frameworks, I have been asked to look at some of the Java frameworks. And, I have been impressed by some of the Java efforts.
Some people have even asked me to look at things like Eclipse RCP and the NetBeans RCP. Several of my colleagues have blogged in the past about the viability of Eclpise RCP as a client-side framework. I feel that I need to take a serious look at it.
You all know that I have been a staunch advocate of .NET in the past. However, I am finding it more difficult to beat back the Java supporters. Some of the arguments that I have used against Java in the past (slowness, not as nice a UI, etc) have been colored by my past experiences with AWT, Swing, and JFC. But, Java GUI development has definitely evolved.
I would love to hear from my blog readers as to why I should continue to push .NET over Java.
Some reasons that I can think of for preferring .NET over Java:
1) I feel C# is a stronger language, and will continue to evolve into an even more powerful entity.
2) Closeness of .NET to the O/S, especially when Vista comes out.
3) Support for .NET inside of SQL Server 2005.
4) Possible business reasons are Microsoft non-support of a JVM and the precarious nature of Sun's balance sheet.
5) Better integrations with the standards in desktop tools (Excel, Word, etc)
©2006 Marc Adler - All Rights Reserved
Saturday, August 26, 2006
Before you start subscribing to market data...
... read this.
Several Wall Street companies have gotten big fines when the exchanges have found out that people or "interrogation devices" that were not entitled to use market data were actually using it. Try looking at this document and see if you can figure out what you need to license if you have a single PC with several different WinForms apps, each app capable of letting one user see the NASDAQ data feed. And, what happens if there are multiple users on that PC?
My colleague Craig tells me that the fee structure imposed by the various exchanges is one of the main driving points for my "Common Wall Street Client Stack", with various applets running inside of one desktop shell.
Wonder if NASDAQ will start charging per AppDomain?
©2006 Marc Adler - All Rights Reserved
Several Wall Street companies have gotten big fines when the exchanges have found out that people or "interrogation devices" that were not entitled to use market data were actually using it. Try looking at this document and see if you can figure out what you need to license if you have a single PC with several different WinForms apps, each app capable of letting one user see the NASDAQ data feed. And, what happens if there are multiple users on that PC?
My colleague Craig tells me that the fee structure imposed by the various exchanges is one of the main driving points for my "Common Wall Street Client Stack", with various applets running inside of one desktop shell.
Wonder if NASDAQ will start charging per AppDomain?
©2006 Marc Adler - All Rights Reserved
Friday, August 25, 2006
We have 4 Open Positions
Want to work with me at a large Investment Bank in NY and NJ?
Here are 4 positions that we have open right now:
- CI and Agile Champion who ideally can also act as a test architect
- Java master with focus on messaging
- Middle Office architect
- Algo architect, which we may re-position as a generalist Java pro
The Middle Office architect can probably be .NET or Java based.
These positons are all for full-timers.
If you are interested, or know anyone who is, then email me at
magmasystems AT yahoo dot com.
©2006 Marc Adler - All Rights Reserved
Here are 4 positions that we have open right now:
- CI and Agile Champion who ideally can also act as a test architect
- Java master with focus on messaging
- Middle Office architect
- Algo architect, which we may re-position as a generalist Java pro
The Middle Office architect can probably be .NET or Java based.
These positons are all for full-timers.
If you are interested, or know anyone who is, then email me at
magmasystems AT yahoo dot com.
©2006 Marc Adler - All Rights Reserved
Sunday, August 20, 2006
An Article on Trading
A bit dated (1995), but here is an article on the trading process. Useful for understanding a bit on order matching and execution algorithms.
©2006 Marc Adler - All Rights Reserved
©2006 Marc Adler - All Rights Reserved
Thursday, August 17, 2006
Comments Added and WMI Blues
I spaced out on approving and publishing the moderated comments (thanks Craig). So now, there are about 30 commnents, dating back from late May.
I was wondering why nobody congratulated me on my new job :-)
Starting to play around with Microsoft's WMI for instrumenting applications. I need to beat up on Microsoft for not letting you author .NET-based WMI providers that allow method invocation and property setters. All you can do with .NET WMI providers are receive events and do property gets. You cannot change a value through a property setting, nor can you manage an application by calling a method on a provider.
Seems that if you want to write a fully-functional WMI provider, then you have to drop down to COM (even using ATL) and C++.
This limitation is severe. This means that I cannot write a .NET app that can be managed by a .NET provider. This means that, if I want to write a monitoring and management dashboard (for monitoring, let's say, a .NET-based trading system), I have to drag out my old COM/ATL books and write unmanaged code. Ugh!
It seems as if plenty of people on the newsgroups share my pain.
©2006 Marc Adler - All Rights Reserved
I was wondering why nobody congratulated me on my new job :-)
Starting to play around with Microsoft's WMI for instrumenting applications. I need to beat up on Microsoft for not letting you author .NET-based WMI providers that allow method invocation and property setters. All you can do with .NET WMI providers are receive events and do property gets. You cannot change a value through a property setting, nor can you manage an application by calling a method on a provider.
Seems that if you want to write a fully-functional WMI provider, then you have to drop down to COM (even using ATL) and C++.
This limitation is severe. This means that I cannot write a .NET app that can be managed by a .NET provider. This means that, if I want to write a monitoring and management dashboard (for monitoring, let's say, a .NET-based trading system), I have to drag out my old COM/ATL books and write unmanaged code. Ugh!
It seems as if plenty of people on the newsgroups share my pain.
©2006 Marc Adler - All Rights Reserved
Friday, August 11, 2006
Silicon on Wall Street (followup)
As a response to my previous posting, my man John weighs in with some words on FPGA's on Wall Street.
As an aside, I notice that there are some good blogs on issues that Wall Street technologists come across every day... John, Chris, DLG, JO'S, and the daddy of them all, Matt. Know of any others?
©2006 Marc Adler - All Rights Reserved
As an aside, I notice that there are some good blogs on issues that Wall Street technologists come across every day... John, Chris, DLG, JO'S, and the daddy of them all, Matt. Know of any others?
©2006 Marc Adler - All Rights Reserved
Thursday, August 10, 2006
Exotics Computations on Silicon?
Someone floated an idea that sounded interesting ...
Has anyone heard of writing their calc functions in C, and burning them onto field programmable gate arrays? The calc models would have to be fairly static, but it might be able to give you magnitudes of speed improvements.
I confess that I know very little about this technology, but it bears some investigation.
Hopefully J.O'S can weigh in with something on his blog....
Here is an interesting article.
©2006 Marc Adler - All Rights Reserved
Has anyone heard of writing their calc functions in C, and burning them onto field programmable gate arrays? The calc models would have to be fairly static, but it might be able to give you magnitudes of speed improvements.
I confess that I know very little about this technology, but it bears some investigation.
Hopefully J.O'S can weigh in with something on his blog....
Here is an interesting article.
©2006 Marc Adler - All Rights Reserved
Wednesday, August 09, 2006
Barrier Options
Barrier Options are considered to be exotic derivatives. Exotics usually take a long time to price, and if you are architecting a trading system, you usually want to put a lot of computing power behind the calculations of exotics. Many trading firms look to Compute Grids and data caches to help speed up some of these calculations.
This explanation of Barrier Options has been taken from the Bank of New York website:
This explanation of Barrier Options has been taken from the Bank of New York website:
SRDF
SRDF is an EMC product family that provides synchronous or async data replication between LUs (logical disk units) of two SAN (Storage Area Networks).
Here is a story about how data replication saved the day in a trading environment at a Tier-1 bank.
Here is a description of a high-performance trading system that uses SRDF. The brochure contains some good points to consider when designing the infrastructure of a trading system. These kinds of infrastructure components were things that I never had to consider previously when I was concentrating solely on writing good software and managing development teams, but in the architecture group, I have to pay attention to this stuff now.
©2006 Marc Adler - All Rights Reserved
Here is a story about how data replication saved the day in a trading environment at a Tier-1 bank.
Here is a description of a high-performance trading system that uses SRDF. The brochure contains some good points to consider when designing the infrastructure of a trading system. These kinds of infrastructure components were things that I never had to consider previously when I was concentrating solely on writing good software and managing development teams, but in the architecture group, I have to pay attention to this stuff now.
©2006 Marc Adler - All Rights Reserved
The First Week and Many New Terms
Sitting here relaxing on the couch after the 2nd day of a grueling offsite. Switching the TV between the Yankee game and the MSG network showing old WWWF highlights from Madison Square Garden (yes, I used to be a major WWWF fan when I was a kid). Perfect TV for unwinding.
It's strange being on the other side of the full-time/employee equation. Being part of the Equities Architecture team, you have various vendors trying to get a piece of your ear. There is no better PR than having your product as piece of a major equities trading system. As such, I am wondering why Microsoft never devoted major effort to attacking the trading system space. Microsoft would be a major force if they came out with the infrastructure to do low-latency, high-volume market data distribution, pub/sub messaging, ultra-fast UI grids, the ability to take an Excel model and compile it into a DLL, etc. Microsoft always seems to be on the cusp on doing something in the trading system space, but has never come through with a compelling, end-to-end story. However, new technologies like Windows Compute Cluster and Excel Services seem to be moving the company in the right direction from a technological standpoint. Plus, their recent announcement to invade the healthcare space has shown a new willingness to attack certain verticals. It still is an uphill battle to sell Microsoft within Capital Markets for anything but UI work ... but people are starting to listen!
I always have a page in the back of my notebook where I write down terms that I need to explore more. Being a .NET specialist and an architecture generalist, I am bound to come up against unfamiliararities. Here are terms from the 2-day offsite that I attended:
1) Barrier Knockout
2) Bishop Algorithm
3) Monte Carlo Trials
4) SSH
5) Alpha Partition
6) MPI (a grid network API)
7) SRDF
8) SANs and Spindle Optimization with regards to Databases
9) Multicast Storms
10) Java NIO, especially with regards to memory-mapped files
By the way, anyone know of a .NET/C# port of NIO?
©2006 Marc Adler - All Rights Reserved
It's strange being on the other side of the full-time/employee equation. Being part of the Equities Architecture team, you have various vendors trying to get a piece of your ear. There is no better PR than having your product as piece of a major equities trading system. As such, I am wondering why Microsoft never devoted major effort to attacking the trading system space. Microsoft would be a major force if they came out with the infrastructure to do low-latency, high-volume market data distribution, pub/sub messaging, ultra-fast UI grids, the ability to take an Excel model and compile it into a DLL, etc. Microsoft always seems to be on the cusp on doing something in the trading system space, but has never come through with a compelling, end-to-end story. However, new technologies like Windows Compute Cluster and Excel Services seem to be moving the company in the right direction from a technological standpoint. Plus, their recent announcement to invade the healthcare space has shown a new willingness to attack certain verticals. It still is an uphill battle to sell Microsoft within Capital Markets for anything but UI work ... but people are starting to listen!
I always have a page in the back of my notebook where I write down terms that I need to explore more. Being a .NET specialist and an architecture generalist, I am bound to come up against unfamiliararities. Here are terms from the 2-day offsite that I attended:
1) Barrier Knockout
2) Bishop Algorithm
3) Monte Carlo Trials
4) SSH
5) Alpha Partition
6) MPI (a grid network API)
7) SRDF
8) SANs and Spindle Optimization with regards to Databases
9) Multicast Storms
10) Java NIO, especially with regards to memory-mapped files
By the way, anyone know of a .NET/C# port of NIO?
©2006 Marc Adler - All Rights Reserved
Wednesday, August 02, 2006
Event Stream Processing
Marco blogs about Event Stream Processing (ESP) at http://rulecore.com/espblog/. There is also a Wikipedia article about it.
ESP is especially interesting in the financial markets, where you want to perform real-time decision making on a stream of quotes coming from your market data distribution infrastructure. ESP gives you opportunities for things like algorithmic trading and real-time risk management.
Companies in this space include Gemstone (Gemfire), KX (KDB+), Vhayu, Streambase, Aleri. I would like to see Microsoft get into this space with a future version of SQL Server. (Since I have some meetings coming up with some people from Microsoft, I will be sure to ask this question.)
I will definitely be exploring this space in the near future.
©2006 Marc Adler - All Rights Reserved
ESP is especially interesting in the financial markets, where you want to perform real-time decision making on a stream of quotes coming from your market data distribution infrastructure. ESP gives you opportunities for things like algorithmic trading and real-time risk management.
Companies in this space include Gemstone (Gemfire), KX (KDB+), Vhayu, Streambase, Aleri. I would like to see Microsoft get into this space with a future version of SQL Server. (Since I have some meetings coming up with some people from Microsoft, I will be sure to ask this question.)
I will definitely be exploring this space in the near future.
©2006 Marc Adler - All Rights Reserved
Tuesday, August 01, 2006
Conflation
The word conflation sounds like a condition that requires you to take a few spoonfuls of Pepto Bizmol. But, it is a term that is used when discussion efficient market data distribution.
The technique has been around for a while. I have always referred to it as aggregation. The term conflation means the combining of data in messages to form one message. You use conflation of messages to overcome slow consumers, limited message queues, and any situation where a message publisher has to throttle the outgoing stream of messages.
Let's say that you are a consumer of stock quotes. The market data distributor receives 1000 quotes for MSFT in one second, but you are only interested in the latest price every second. So, the market data distributor will conflate all of the MSFT quote messages into a single message that gets broadcast to you every second. This means that the server will only send you the last bid/ask price.
You can choose various parameters for the conflation. For instance, as mentioned above, you might want time-based conflation (every 2 seconds, every 30 seconds, etc), you may want conflation based on the size of your message queue, or you might choose your own custom way of doing conflation.
©2006 Marc Adler - All Rights Reserved
The technique has been around for a while. I have always referred to it as aggregation. The term conflation means the combining of data in messages to form one message. You use conflation of messages to overcome slow consumers, limited message queues, and any situation where a message publisher has to throttle the outgoing stream of messages.
Let's say that you are a consumer of stock quotes. The market data distributor receives 1000 quotes for MSFT in one second, but you are only interested in the latest price every second. So, the market data distributor will conflate all of the MSFT quote messages into a single message that gets broadcast to you every second. This means that the server will only send you the last bid/ask price.
You can choose various parameters for the conflation. For instance, as mentioned above, you might want time-based conflation (every 2 seconds, every 30 seconds, etc), you may want conflation based on the size of your message queue, or you might choose your own custom way of doing conflation.
©2006 Marc Adler - All Rights Reserved
Monday, July 31, 2006
Consulting Firms - What Should We Charge?
(This was a post on my blog from a few months ago that I took down. The numbers in this post were arrived at during the course of one train ride from New Jersey to NYC, and in no way are derived from any real consulting firm. These are numbers that should be considered if you are going to start your own IT consulting firm. I also included some of the comments that the original post garnered.)
Consulting Firms - What Should We Charge?
On another blog, a person who is in charge of some consulting dollars (or pounds) at his company questioned why they should pay $X to one consulting company when some temp contractors could do it for $0.5X.
That got me thinking (yet again) about how much high-end consultancies should charge a client per hour or per professional day. I came up with some numbers that I would like to share.
Before I start, some things I want to mention:1) Please feel free to comment in case my numbers are way off base.2) The numbers have no connection whatsoever with Finetix, my former employer. These numbers were arrived at by opening up a random number of fortune cookies and summing up the lottery numbers. 3) These figures are for the US marketplace. I have no idea what the British equivalents to Social Security Tax and 401K plans are.
Fixed Costs Per Employee
------------------------
1) Salary
We want to have a consultancy that has top technical people who have some amount of financial background. We are looking for .NET and Java experts who have done some work on Wall Street in the past, and who can at least tell me what a bond is. In a previous blog posting, I mentioned that the current base salary on Wall Street for this level is about $150,000.
2) 401K/retirement Plan
Let's say that you have a 3% 401K. That adds another $5000.
3) Bonus
Always a tricky thing. Let's take $10,000 for a job well done.
4) Insurance
We pay 2/3 of an employees medical and dental insurance. This amount to about $7000 per year. We also have to pay some other taxes, such an unemployment insurance, etc.
5) Social Security tax
We pay about 7.15 of the person's first $90,000 in income. This is about $6000.
Subtotal - We are paying about $178,000 in salary and benefits per employee.
Costs of Running the Business
-----------------------------
1) Back office staff to support 40 delivery people. We need about 10 people. There are 3 partners, director of Human Resources, director of Benefits, director of Recruiting, two salespeople, director of marketing, plus administrative assistant. If we wanted to chop some dollars, we could probably combine the HR and Benefits. Some of the people are paid totally on commission, some partly, and some are strictly salaried. The partners pay themselves a fixed base salary. So, I am going to put this roughly at $1M.
2) Rent
Nice offices in New York, satellite offices in various locations. Also, cost of utilities, cleaning services, a nice tip for the elevator operators and cleaning people, etc. Let's estimate $400,000.
3) Office Supplies, Furniture, Postage, ISP, etc.
Let's say $100,000.
4) Other items:
- Interest on the Float. The "float' is the number of days between the time you pay your employees and the time you finally collect money from the client.
- Client "incentives" - that nasty, unspoken cost of doing business.
- Marketing Budget
- Conferences and professional organizations
5) Corporate Taxes!!!!
Subtotal - Let's guess about $2M. If we have 40 consultants generating revenue, this is about $50,000 per consultant.
So, now we have the cost per consultant at around $230,000 per year. There are about 230 possible consulting days per year (365 days - 104 weekends - 15 vacation - 10 holidays plus some sick days). This means, if the consultant was billing for all 230 days, we would have to charge the client $1000 per day just to break even. Now, let's say that each consultant is allowed about 10 days of bench time per year. This brings our daily rate up to about $1100.How much profit margin should the partners have? From dealing with various headhunters, I would assume a good profit margin to be about 25-30%. This means that we should be charging a client about $1400 for a consultant.
Our consulting company has a mixture of various skill levels. Some people are more junior than others. So, we create a rate card that goes from $1200 per day for a junior person, to $1600 per day for a senior person. This comes out to $150 to $200 per hour.
Now, at that rate, we are relatively cheap compared to other consulting companies. Microsoft Consulting charges at least $2000 per day. IBM and BearingPoint charge at least $250 per hour for a junior consultant, up to about $450 an hour for a director.
Who are our customers? Certainly, the tier 1 and tier 2 financial institutions. Pharma companies are not going to pay these rates. We are looking to deal with clients who can appreciate our talent pool and who can afford to pay.
Wanna start your own consultancy? These are the numbers that you will have to deal with.
8 Comments:
· I think you're a little on the low side. My former employer charged $250 to $320 per hour, and we had pharmas and other corporates in our clientelle.In yours costs, perhaps factor in some free consulting time to fix screw-ups, late deliveries, etc.What about training? If you want to justify your rate you need highly trained, up to date employees. This is why I left, my employer made no investment in me. I had to train myself on my time, which left me often working around the clock.10 days on the bench per year! Man, I do NOT miss consulting!
By Burnt Out, at 5:38 PM
· Wouldn't the partners take a % of the profits rather than a salary?What about training, free days to clients, sick days?Why isn't the employees bonus based on a % of the profits the company makes?Based on your calculations the is a backoffice person for every 4 consultants? I hate to see the size of the backoffice for 1000 consultantsWhy don't I offshore some of my the work?Can't your consultancy do fixed price?
By Anonymous, at 6:30 PM
· Wouldn't the partners take a % of the profits rather than a salary?Possibly. Depends on how risk-averse the partners were. If I was a partner, I would pay myself a low salary ($100K) and then at the end of the year, divvy up the profits.What about training, free days to clients, sick days?I mentioned 5 sick days in my original post. Training is nice, and I would like to give at least a week of training, so that can be done during the 10 days of bench time. OK, let's add in about $100K for training. Free days to clients? Never heard of this!Why isn't the employees bonus based on a % of the profits the company makes?Because many smart people will negotiate a guaranteed fixed bonus when they join, especially since the debacles of 2002 and 2003. But I might give an added "incentive" bonus to some of my best performers at the end of the year. OK, let's add another 100K.Based on your calculations the is a backoffice person for every 4 consultants? I hate to see the size of the backoffice for 1000 consultants10 people should be a constant. Even when your company grows to 100 people. In fact, at the start, I might consider consolidating the benefits and HR functions, and make the partners do more marketing. So, we can cut our staff back to 8.Why don't I offshore some of my the work?Never, never! This is what distinguishes my shop from other larger ones. Strictly all client-facing work.Can't your consultancy do fixed price?I abhor fixed-price contracts. We could do it, but perhaps under duress!One thing that I forgot to mention was finder’s fees. If I hire a person through an employment agency, then I have to pay then 15-30% of the employee's first year salary. That's a significant chunk. Let's assume $30,000 for 10 people, and that's another $300,000.So, we have added another $500,000 in costs to our model. That's about $10K per employee. Gotta bump up the rate card by $50 per day. So, our rate card is now $1250 through $1650. And, coincidentally, $1650 per day is what a lot of the top-tier banks pay for senior technical people.
©2006 Marc Adler - All Rights Reserved
Consulting Firms - What Should We Charge?
On another blog, a person who is in charge of some consulting dollars (or pounds) at his company questioned why they should pay $X to one consulting company when some temp contractors could do it for $0.5X.
That got me thinking (yet again) about how much high-end consultancies should charge a client per hour or per professional day. I came up with some numbers that I would like to share.
Before I start, some things I want to mention:1) Please feel free to comment in case my numbers are way off base.2) The numbers have no connection whatsoever with Finetix, my former employer. These numbers were arrived at by opening up a random number of fortune cookies and summing up the lottery numbers. 3) These figures are for the US marketplace. I have no idea what the British equivalents to Social Security Tax and 401K plans are.
Fixed Costs Per Employee
------------------------
1) Salary
We want to have a consultancy that has top technical people who have some amount of financial background. We are looking for .NET and Java experts who have done some work on Wall Street in the past, and who can at least tell me what a bond is. In a previous blog posting, I mentioned that the current base salary on Wall Street for this level is about $150,000.
2) 401K/retirement Plan
Let's say that you have a 3% 401K. That adds another $5000.
3) Bonus
Always a tricky thing. Let's take $10,000 for a job well done.
4) Insurance
We pay 2/3 of an employees medical and dental insurance. This amount to about $7000 per year. We also have to pay some other taxes, such an unemployment insurance, etc.
5) Social Security tax
We pay about 7.15 of the person's first $90,000 in income. This is about $6000.
Subtotal - We are paying about $178,000 in salary and benefits per employee.
Costs of Running the Business
-----------------------------
1) Back office staff to support 40 delivery people. We need about 10 people. There are 3 partners, director of Human Resources, director of Benefits, director of Recruiting, two salespeople, director of marketing, plus administrative assistant. If we wanted to chop some dollars, we could probably combine the HR and Benefits. Some of the people are paid totally on commission, some partly, and some are strictly salaried. The partners pay themselves a fixed base salary. So, I am going to put this roughly at $1M.
2) Rent
Nice offices in New York, satellite offices in various locations. Also, cost of utilities, cleaning services, a nice tip for the elevator operators and cleaning people, etc. Let's estimate $400,000.
3) Office Supplies, Furniture, Postage, ISP, etc.
Let's say $100,000.
4) Other items:
- Interest on the Float. The "float' is the number of days between the time you pay your employees and the time you finally collect money from the client.
- Client "incentives" - that nasty, unspoken cost of doing business.
- Marketing Budget
- Conferences and professional organizations
5) Corporate Taxes!!!!
Subtotal - Let's guess about $2M. If we have 40 consultants generating revenue, this is about $50,000 per consultant.
So, now we have the cost per consultant at around $230,000 per year. There are about 230 possible consulting days per year (365 days - 104 weekends - 15 vacation - 10 holidays plus some sick days). This means, if the consultant was billing for all 230 days, we would have to charge the client $1000 per day just to break even. Now, let's say that each consultant is allowed about 10 days of bench time per year. This brings our daily rate up to about $1100.How much profit margin should the partners have? From dealing with various headhunters, I would assume a good profit margin to be about 25-30%. This means that we should be charging a client about $1400 for a consultant.
Our consulting company has a mixture of various skill levels. Some people are more junior than others. So, we create a rate card that goes from $1200 per day for a junior person, to $1600 per day for a senior person. This comes out to $150 to $200 per hour.
Now, at that rate, we are relatively cheap compared to other consulting companies. Microsoft Consulting charges at least $2000 per day. IBM and BearingPoint charge at least $250 per hour for a junior consultant, up to about $450 an hour for a director.
Who are our customers? Certainly, the tier 1 and tier 2 financial institutions. Pharma companies are not going to pay these rates. We are looking to deal with clients who can appreciate our talent pool and who can afford to pay.
Wanna start your own consultancy? These are the numbers that you will have to deal with.
8 Comments:
· I think you're a little on the low side. My former employer charged $250 to $320 per hour, and we had pharmas and other corporates in our clientelle.In yours costs, perhaps factor in some free consulting time to fix screw-ups, late deliveries, etc.What about training? If you want to justify your rate you need highly trained, up to date employees. This is why I left, my employer made no investment in me. I had to train myself on my time, which left me often working around the clock.10 days on the bench per year! Man, I do NOT miss consulting!
By Burnt Out, at 5:38 PM
· Wouldn't the partners take a % of the profits rather than a salary?What about training, free days to clients, sick days?Why isn't the employees bonus based on a % of the profits the company makes?Based on your calculations the is a backoffice person for every 4 consultants? I hate to see the size of the backoffice for 1000 consultantsWhy don't I offshore some of my the work?Can't your consultancy do fixed price?
By Anonymous, at 6:30 PM
· Wouldn't the partners take a % of the profits rather than a salary?Possibly. Depends on how risk-averse the partners were. If I was a partner, I would pay myself a low salary ($100K) and then at the end of the year, divvy up the profits.What about training, free days to clients, sick days?I mentioned 5 sick days in my original post. Training is nice, and I would like to give at least a week of training, so that can be done during the 10 days of bench time. OK, let's add in about $100K for training. Free days to clients? Never heard of this!Why isn't the employees bonus based on a % of the profits the company makes?Because many smart people will negotiate a guaranteed fixed bonus when they join, especially since the debacles of 2002 and 2003. But I might give an added "incentive" bonus to some of my best performers at the end of the year. OK, let's add another 100K.Based on your calculations the is a backoffice person for every 4 consultants? I hate to see the size of the backoffice for 1000 consultants10 people should be a constant. Even when your company grows to 100 people. In fact, at the start, I might consider consolidating the benefits and HR functions, and make the partners do more marketing. So, we can cut our staff back to 8.Why don't I offshore some of my the work?Never, never! This is what distinguishes my shop from other larger ones. Strictly all client-facing work.Can't your consultancy do fixed price?I abhor fixed-price contracts. We could do it, but perhaps under duress!One thing that I forgot to mention was finder’s fees. If I hire a person through an employment agency, then I have to pay then 15-30% of the employee's first year salary. That's a significant chunk. Let's assume $30,000 for 10 people, and that's another $300,000.So, we have added another $500,000 in costs to our model. That's about $10K per employee. Gotta bump up the rate card by $50 per day. So, our rate card is now $1250 through $1650. And, coincidentally, $1650 per day is what a lot of the top-tier banks pay for senior technical people.
©2006 Marc Adler - All Rights Reserved
Wednesday, July 26, 2006
The Start of a New Adventure
On the eve of starting a great, new, exciting position, I would like to recap my experiences over the past 4 weeks in searching for a new job. One of the motivating factors in looking for a new job was that I wanted to have an important role in shaping the development and architecture of a major financial system, and do so at a senior level. Being a hands-on coder was OK for me on a part-time basis, but I wanted to manage and mentor developers who would be doing most of the coding while devoting more of my time to learning about new technologies in the financial arena, meeting with vendors, sitting on enterprise architecture committees, etc.
It’s always good to have some throwaway interviews, especially if you have not interviewed in quite a while. As soon as I announced my intentions of moving on to something different, I received a number of calls for interviews. I knew that some of the positions were not right for me, but I needed to get some spit and polish on my interviewing style before going out to the big boys.
The first interview was for a consulting company that claimed to do some financial work, but whose main focus was content management. Nevertheless, I needed to meet with people, so I went down for the interviews. The company had a “boiler room” full of cold-callers, something that makes my blood curdle. I met with the “HR lady” and then (believe it or not), the Head of Business Development. What kind of company would have you meet with their head salesperson? After my ideas about how a consulting company should be run went right over the salesguy’s head, I met with one of the partners. He was more perceptive, in that when I told him that I did not want to work for a consulting company that had the singleton, bodyshopping model, I could detect the dark cloud passing over his face and his immediate desire to end the interview as soon as possible.
The next day was another throwaway. A hedge fund had been after me for a few months. The headhunter told me that, as part of the job spec, the hedge fund requested that candidates live in New York City so that they could be on constant call. 14 hour days were the minimum. Joking with the headhunter, I told him that if I were to work 14 hour days, that I would want my current salary * 1.75 as a base. He called me back a week later and said that the hedge fund still wanted to talk to me. After an initial phone interview, I went down to see the people from the hedge fund. The fund is technically astute; they were developing totally in .NET 2.0, although they were doing all ASP.NET apps. The only thing that the first two interviewers, both developers, did was to repeatedly thumb through my resume, and exclaim that I had done a lot of stuff. Finally, I interviewed with the CTO. We talked about a lot of conceptual things, and he asked me one SQL question, which I got about half right. (I happen to have a mental block when it comes to writing SQL during an interview – give me SQL Query Analyzer, and I can work up the answer in 5 minutes). When the CTO asked me about my compensation requirements, I told him that I thought that the recruiter communicated that to him already. The recruiter never did, and when I mentioned the figure to him, he rolled onto the floor laughing. We ended the interview about 8PM, and he told me that his day was just beginning.
Two interviews without a good tech question.
The next interview was with another, very small hedge fund. The CTO was a really nice guy, except that I wanted his job! The pay was terrible. About 60% of my current base, although a 30-40% bonus was typical. To his credit, the CTO knew that he could not support my compensation level, and we both knew that it would have been a mismatch if I had joined.
Still no tech questions.
Later that day, I went down for a face-to-face with a very small company that specialized in financial tools. I had actually spoken briefly to this company a few months ago, but they really wanted a GUI developer who specialized in C++. Seeking a good throwaway interview with some good, hard tech questions, I contacted this company again to see if the position was open. It was! I had an initial one-hour phone conversation with their senior developer, and then was invited down to their offices for a second round. The questions I was asked included:
- Design the architecture and the API for a logging mechanism
- Implement a breadth-first and depth-first search for a tree.
- Design a hash table.
- Implement a workflow manager.
When the CEO of the company walked in to interview me, I almost fainted. The CEO looked like he was 12 years old. (He is actually a MIT grad.) I felt like I was interviewing my son. OK, I think that we both realized at that point that there was a slight cultural difference!
A phone interview with one of the big IBs followed. The job spec was for a C# developer for an Order Management System, but the recruiter kept insisting that it was a Managing Director’s position. I told the recruiter specifically that I did not want an Associate Director or Director position at this company, but she kept changing her story with regards to the title. The phone interview was a non-event. No tech questions; just a manager going over my past projects and asking me where I wanted to be five years from now. A very, very dry interview.
Then came two wonderful interviews with two different groups at an IB, one for consulting and one for full-time. I got offers from both these interviews. More on this later. I was asked to design a crossing engine. I was asked about the .NET garbage collector. I was asked to draw an architecture for a trading system. I was asked about bottlenecks in the system.
I got verbal offers from both of these groups the next day.
I knew that I was going to take one of these two positions, but I went on two other interviews as backups. One was with a big ad agency who needed rearchitecture of some big websites. Nice company located in the hinterlands of New Jersey, and they came through with a very nice consulting offer at a pretty good rate. It would have been a good change of pace, and I would have taken it if the other offers did not come through. Another interview was a phone talk with the head dev and the manager of a group at another IB. Their systems were in a mess, and they needed rearchitecture and new development on their big Private Banking systems. Not really a position that I wanted. Both of these interviews contained no tech questions.
One other background conversation was with a small company that specialized in software and consulting services for hedge funds. Really nice guys, and would have been great if I had wanted to bill by the hour and customize software for individual funds, but they were looking at me to take over the CTO role. Unfortunately, they did not have a sufficient revenue stream to support non-client-billable activities, and sadly, it would have been more of singleton consulting.
In the course of interviewing, I met some very good recruiters who I will be sure to use in my new position when I need staff. I also met some very, very bad recruiters who a) did not communicate salary requirements to their clients, b) did not give me feedback, c) lied about the titles of the positions. Among the goodies I met were Matt of SH and Drew of CMA. Cheers guys!
I was disappointed in the level of tech questions that I received, and was surprised that most of the interviewers would just spend time gawking at my resume. They were actually embarrassed to ask me the generic tech questions (ie: what is a virtual function, what is a delegate, etc). However, the design-a-system questions were good, and I have to remember to use some of them, especially the one about designing a workflow engine.
My new position is a senior-level position at one of the IBs. I will be in charge of architecting some new trading systems and rearchitecting some older ones. I will have a small staff of good people. My manager is a very dynamic personality, and I am hoping that we can move this organization forward in terms of trading technology. I will be involved in new technologies (to me, at least), and will be investigating low-latency market data distribution, algorithmic trading, universal GUIs (my Wall Street Stack), and more.
©2006 Marc Adler - All Rights Reserved
It’s always good to have some throwaway interviews, especially if you have not interviewed in quite a while. As soon as I announced my intentions of moving on to something different, I received a number of calls for interviews. I knew that some of the positions were not right for me, but I needed to get some spit and polish on my interviewing style before going out to the big boys.
The first interview was for a consulting company that claimed to do some financial work, but whose main focus was content management. Nevertheless, I needed to meet with people, so I went down for the interviews. The company had a “boiler room” full of cold-callers, something that makes my blood curdle. I met with the “HR lady” and then (believe it or not), the Head of Business Development. What kind of company would have you meet with their head salesperson? After my ideas about how a consulting company should be run went right over the salesguy’s head, I met with one of the partners. He was more perceptive, in that when I told him that I did not want to work for a consulting company that had the singleton, bodyshopping model, I could detect the dark cloud passing over his face and his immediate desire to end the interview as soon as possible.
The next day was another throwaway. A hedge fund had been after me for a few months. The headhunter told me that, as part of the job spec, the hedge fund requested that candidates live in New York City so that they could be on constant call. 14 hour days were the minimum. Joking with the headhunter, I told him that if I were to work 14 hour days, that I would want my current salary * 1.75 as a base. He called me back a week later and said that the hedge fund still wanted to talk to me. After an initial phone interview, I went down to see the people from the hedge fund. The fund is technically astute; they were developing totally in .NET 2.0, although they were doing all ASP.NET apps. The only thing that the first two interviewers, both developers, did was to repeatedly thumb through my resume, and exclaim that I had done a lot of stuff. Finally, I interviewed with the CTO. We talked about a lot of conceptual things, and he asked me one SQL question, which I got about half right. (I happen to have a mental block when it comes to writing SQL during an interview – give me SQL Query Analyzer, and I can work up the answer in 5 minutes). When the CTO asked me about my compensation requirements, I told him that I thought that the recruiter communicated that to him already. The recruiter never did, and when I mentioned the figure to him, he rolled onto the floor laughing. We ended the interview about 8PM, and he told me that his day was just beginning.
Two interviews without a good tech question.
The next interview was with another, very small hedge fund. The CTO was a really nice guy, except that I wanted his job! The pay was terrible. About 60% of my current base, although a 30-40% bonus was typical. To his credit, the CTO knew that he could not support my compensation level, and we both knew that it would have been a mismatch if I had joined.
Still no tech questions.
Later that day, I went down for a face-to-face with a very small company that specialized in financial tools. I had actually spoken briefly to this company a few months ago, but they really wanted a GUI developer who specialized in C++. Seeking a good throwaway interview with some good, hard tech questions, I contacted this company again to see if the position was open. It was! I had an initial one-hour phone conversation with their senior developer, and then was invited down to their offices for a second round. The questions I was asked included:
- Design the architecture and the API for a logging mechanism
- Implement a breadth-first and depth-first search for a tree.
- Design a hash table.
- Implement a workflow manager.
When the CEO of the company walked in to interview me, I almost fainted. The CEO looked like he was 12 years old. (He is actually a MIT grad.) I felt like I was interviewing my son. OK, I think that we both realized at that point that there was a slight cultural difference!
A phone interview with one of the big IBs followed. The job spec was for a C# developer for an Order Management System, but the recruiter kept insisting that it was a Managing Director’s position. I told the recruiter specifically that I did not want an Associate Director or Director position at this company, but she kept changing her story with regards to the title. The phone interview was a non-event. No tech questions; just a manager going over my past projects and asking me where I wanted to be five years from now. A very, very dry interview.
Then came two wonderful interviews with two different groups at an IB, one for consulting and one for full-time. I got offers from both these interviews. More on this later. I was asked to design a crossing engine. I was asked about the .NET garbage collector. I was asked to draw an architecture for a trading system. I was asked about bottlenecks in the system.
I got verbal offers from both of these groups the next day.
I knew that I was going to take one of these two positions, but I went on two other interviews as backups. One was with a big ad agency who needed rearchitecture of some big websites. Nice company located in the hinterlands of New Jersey, and they came through with a very nice consulting offer at a pretty good rate. It would have been a good change of pace, and I would have taken it if the other offers did not come through. Another interview was a phone talk with the head dev and the manager of a group at another IB. Their systems were in a mess, and they needed rearchitecture and new development on their big Private Banking systems. Not really a position that I wanted. Both of these interviews contained no tech questions.
One other background conversation was with a small company that specialized in software and consulting services for hedge funds. Really nice guys, and would have been great if I had wanted to bill by the hour and customize software for individual funds, but they were looking at me to take over the CTO role. Unfortunately, they did not have a sufficient revenue stream to support non-client-billable activities, and sadly, it would have been more of singleton consulting.
In the course of interviewing, I met some very good recruiters who I will be sure to use in my new position when I need staff. I also met some very, very bad recruiters who a) did not communicate salary requirements to their clients, b) did not give me feedback, c) lied about the titles of the positions. Among the goodies I met were Matt of SH and Drew of CMA. Cheers guys!
I was disappointed in the level of tech questions that I received, and was surprised that most of the interviewers would just spend time gawking at my resume. They were actually embarrassed to ask me the generic tech questions (ie: what is a virtual function, what is a delegate, etc). However, the design-a-system questions were good, and I have to remember to use some of them, especially the one about designing a workflow engine.
My new position is a senior-level position at one of the IBs. I will be in charge of architecting some new trading systems and rearchitecting some older ones. I will have a small staff of good people. My manager is a very dynamic personality, and I am hoping that we can move this organization forward in terms of trading technology. I will be involved in new technologies (to me, at least), and will be investigating low-latency market data distribution, algorithmic trading, universal GUIs (my Wall Street Stack), and more.
©2006 Marc Adler - All Rights Reserved
Tuesday, July 25, 2006
Testing, Testing
Anyone out there still?
Important announcement coming soon....
©2006 Marc Adler - All Rights Reserved
Important announcement coming soon....
©2006 Marc Adler - All Rights Reserved
Monday, June 26, 2006
Next Move
I am in the market for new opportunities. My interests are hedge funds, trading technology, .NET.
If you have something interesting going on, please email me at magmasystems@yahoo.com
I am going to take a few weeks off, investigate technologies that I have been too busy to investigate, and watch the rest of the World Cup.
©2006 Marc Adler - All Rights Reserved
If you have something interesting going on, please email me at magmasystems@yahoo.com
I am going to take a few weeks off, investigate technologies that I have been too busy to investigate, and watch the rest of the World Cup.
©2006 Marc Adler - All Rights Reserved
Sunday, June 25, 2006
Things to Learn
Going through some of the reading from SIA. Tons and tons of stuff out there. On my "to-learn" list are:
MDDL - market data definition language, yet another XML-based way of transmitting financial info
Gigaspaces - grid-based infrastructure
Vhayu - real-time and historical data storage with real-time calculations and event broadcasting
Wombat - another high-speed market data and messaging platform
©2006 Marc Adler - All Rights Reserved
MDDL - market data definition language, yet another XML-based way of transmitting financial info
Gigaspaces - grid-based infrastructure
Vhayu - real-time and historical data storage with real-time calculations and event broadcasting
Wombat - another high-speed market data and messaging platform
©2006 Marc Adler - All Rights Reserved
Another Interesting Job Posting
http://newyork.craigslist.org/mnh/sof/173118487.html
They are located on the 4th floor of a building on Franklin Street, which is in the area of New York City called TriBeCa. In the old days, Franklin Street had many spacious lofts ... which got me thinking back to the days where a lot of young software companies worked out of lofts or apartments. In fact, in 1986, I worked for a young startup called Multex. There were 3 or 4 of us sitting in an apartment on West 53rd Street, coding apps for Goldman Sachs. Multex went on to expand, go public, and get bought out by Reuters.
Former Multex employee Brett Schlussman left just after me, and formed NetLogic with another former Multex guy (Michael St. Hippolyte) and a developer from Bankers Trust. They worked out of Brett's apartment in the 20's, taking Brett's Windows-based 3270 emulator that he developed for First Boston and selling it to Eicon.
We have interviewed a number of ex-Multex employees recently at Finetix. These were people who joined Multex after the Reuters merger. They had no idea that they were being interviewed by Multex employee number 5.
©2006 Marc Adler - All Rights Reserved
They are located on the 4th floor of a building on Franklin Street, which is in the area of New York City called TriBeCa. In the old days, Franklin Street had many spacious lofts ... which got me thinking back to the days where a lot of young software companies worked out of lofts or apartments. In fact, in 1986, I worked for a young startup called Multex. There were 3 or 4 of us sitting in an apartment on West 53rd Street, coding apps for Goldman Sachs. Multex went on to expand, go public, and get bought out by Reuters.
Former Multex employee Brett Schlussman left just after me, and formed NetLogic with another former Multex guy (Michael St. Hippolyte) and a developer from Bankers Trust. They worked out of Brett's apartment in the 20's, taking Brett's Windows-based 3270 emulator that he developed for First Boston and selling it to Eicon.
We have interviewed a number of ex-Multex employees recently at Finetix. These were people who joined Multex after the Reuters merger. They had no idea that they were being interviewed by Multex employee number 5.
©2006 Marc Adler - All Rights Reserved
Wednesday, June 21, 2006
SIA Technology Show 2006
I stopped by the Securities Industry Association show at lunchtime today. Walked around the exhibit hall and saw 1000 different instances of "the Wall Street Stack". Ow .... my head hurt from thinking about how many times the same stack has been rewritten in different ways for the sole purpose of displaying real-time charts and blotters. If you were a financial software company, how much would you pay for a completely operational version of The Stack?
Picked up a least 50 magazines, newsletters, and newspapers on trading technologies (hardly anyone was giving out T-Shirts this year -- I am a real T-Shirt collector). Waters Magazine still seems to be the best one out there for hard-core Wall Street developers.
There was a nice article on pages 21 and 22 of the Summer 2006 issue of Windows in Financial Services on a framework that I helped architect at Wachovia last year. The framework is what they now call OneSource. Several apps in Wachovia are based on OneSource, and I am happy to report that the ClientNet application that I worked on last year is being rolled out worldwide at Wachovia. One of the mags had a nice bit on the adoption of grid technololgies within Wachovia --- my man R.O. rolled that stuff out.
Larry from Finetix gave a nice talk on Quality Assurance in Capital Markets. Hopefully, some past and current clients attended that one! Larry is one of the best in the business.
Fourth of July coming up .... we have to get ourselves out to Block Island

©2006 Marc Adler - All Rights Reserved
Picked up a least 50 magazines, newsletters, and newspapers on trading technologies (hardly anyone was giving out T-Shirts this year -- I am a real T-Shirt collector). Waters Magazine still seems to be the best one out there for hard-core Wall Street developers.
There was a nice article on pages 21 and 22 of the Summer 2006 issue of Windows in Financial Services on a framework that I helped architect at Wachovia last year. The framework is what they now call OneSource. Several apps in Wachovia are based on OneSource, and I am happy to report that the ClientNet application that I worked on last year is being rolled out worldwide at Wachovia. One of the mags had a nice bit on the adoption of grid technololgies within Wachovia --- my man R.O. rolled that stuff out.
Larry from Finetix gave a nice talk on Quality Assurance in Capital Markets. Hopefully, some past and current clients attended that one! Larry is one of the best in the business.
Fourth of July coming up .... we have to get ourselves out to Block Island

©2006 Marc Adler - All Rights Reserved
Tuesday, June 20, 2006
Derman is in the House
Famed quant Emanuel Derman is blogging.
http://www.wilmott.com/blogs/eman/index.cfm
I just started reading his book My Life as a Quant. Interesting to read his experiences at Bell Labs at the start of the whole Unix/C movement in the late 1970's.
I will definitely have some more comments as I read through the book.
©2006 Marc Adler - All Rights Reserved
http://www.wilmott.com/blogs/eman/index.cfm
I just started reading his book My Life as a Quant. Interesting to read his experiences at Bell Labs at the start of the whole Unix/C movement in the late 1970's.
I will definitely have some more comments as I read through the book.
©2006 Marc Adler - All Rights Reserved
Sunday, June 18, 2006
Friday, June 16, 2006
YABGT (Yet Another Bill Gates Tribute)
I will join all of the other bloggers out there and put in my two cents about Bill Gates.
I had my first and only brush with Gates back in 1991 or 1992. I was a contributing editor for Microsoft Systems Journal back in the old days. One day, I get a call from my editor. He tells me that Bill Gates is stopping in New York for a night, on his way back to Seattle from a European trip. He wanted to have dinner with the MSJ contributing editors to tell them about some exciting stuff in the industry. Would I be interested?
We all met at a Japanese hotel on Park Ave at 32nd St. This hotel had a beautiful restaurant, and Gates, being a sushi fanatic, reserved a tatani room for us.
We all get there at 8PM, and then in walks Gates, followed by his flack, Jon Lazarus (who used to be the publisher of MSJ). In attendance was myself, Ross Greenburg (author of RamNet, and later, some virus-checking program), Greg Comeau (author of Comeau C++), Charles Petzold (author of a book), and Tony Rizzo (my editor).
Gates turned out to be a great guy, despite the constant leg movements under the table. Very personable. He spent most of the night talking about getting Dave Cutler from DEC, and the new operating system he was working on (Windows NT). Every word was preceeded by a stern warning from Lazarus never to repeat what was said.
Of course, the very next week, PC Week featured a big story on Cutler and NT!!!
©2006 Marc Adler - All Rights Reserved
I had my first and only brush with Gates back in 1991 or 1992. I was a contributing editor for Microsoft Systems Journal back in the old days. One day, I get a call from my editor. He tells me that Bill Gates is stopping in New York for a night, on his way back to Seattle from a European trip. He wanted to have dinner with the MSJ contributing editors to tell them about some exciting stuff in the industry. Would I be interested?
We all met at a Japanese hotel on Park Ave at 32nd St. This hotel had a beautiful restaurant, and Gates, being a sushi fanatic, reserved a tatani room for us.
We all get there at 8PM, and then in walks Gates, followed by his flack, Jon Lazarus (who used to be the publisher of MSJ). In attendance was myself, Ross Greenburg (author of RamNet, and later, some virus-checking program), Greg Comeau (author of Comeau C++), Charles Petzold (author of a book), and Tony Rizzo (my editor).
Gates turned out to be a great guy, despite the constant leg movements under the table. Very personable. He spent most of the night talking about getting Dave Cutler from DEC, and the new operating system he was working on (Windows NT). Every word was preceeded by a stern warning from Lazarus never to repeat what was said.
Of course, the very next week, PC Week featured a big story on Cutler and NT!!!
©2006 Marc Adler - All Rights Reserved
Sunday, June 11, 2006
Thursday, June 01, 2006
Housing Price Futures
I heard about this on NPR radio the other day ... A great way of hedging a housing market. If you are buying now, and are afraid that the housing market might fall through the floor in your town, then you can short the housing future. If you think that your area might see an uptick in housing, then long the future.
(from a CBS Marketwatch article)
The Chicago Merc introduced cash-settled futures and options based on housing markets in Boston, Chicago, Denver, Las Vegas, Los Angeles, Miami, New York, San Diego, San Francisco and Washington, as well as a weighted composite index.
The contracts are priced by multiplying the index value by $250; the average contract size for the various cities is roughly $55,000, although they vary by region, according to Sayee Srinivasan, associate director of research and product development at the CME. He said the exchange is considering adding contracts for other booming real-estate markets such as Phoenix and Orlando.
"The futures markets like volatility, so the contracts based on the most volatile housing markets might see the most volume," Srinivasan said.
For each region, there are four contracts, which expire on a quarterly basis, so there are currently contracts for August 2006, November 2006, February 2007 and May 2007.
Although the contracts have only been trading for a very short period, most of the interest is looking further out on the curve with the May 2007 contracts getting the most action initially, said Fritz Siebel, senior broker at Traditional Financial Services Inc.
There could be demand for longer-dated contracts, something the CME is considering if the existing contracts prove popular enough.
Siebel noted the early interest has been in derivatives based on hot West Coast markets in San Diego, Los Angeles and Las Vegas, and also Miami on the East Coast.
©2006 Marc Adler - All Rights Reserved
(from a CBS Marketwatch article)
The Chicago Merc introduced cash-settled futures and options based on housing markets in Boston, Chicago, Denver, Las Vegas, Los Angeles, Miami, New York, San Diego, San Francisco and Washington, as well as a weighted composite index.
The contracts are priced by multiplying the index value by $250; the average contract size for the various cities is roughly $55,000, although they vary by region, according to Sayee Srinivasan, associate director of research and product development at the CME. He said the exchange is considering adding contracts for other booming real-estate markets such as Phoenix and Orlando.
"The futures markets like volatility, so the contracts based on the most volatile housing markets might see the most volume," Srinivasan said.
For each region, there are four contracts, which expire on a quarterly basis, so there are currently contracts for August 2006, November 2006, February 2007 and May 2007.
Although the contracts have only been trading for a very short period, most of the interest is looking further out on the curve with the May 2007 contracts getting the most action initially, said Fritz Siebel, senior broker at Traditional Financial Services Inc.
There could be demand for longer-dated contracts, something the CME is considering if the existing contracts prove popular enough.
Siebel noted the early interest has been in derivatives based on hot West Coast markets in San Diego, Los Angeles and Las Vegas, and also Miami on the East Coast.
©2006 Marc Adler - All Rights Reserved
Wednesday, May 24, 2006
FX Settlements
The CLS website has a great picture on how settlements work for FX trades. Here it is:

CLS is a bank set up by a consortium of different financial firms. It what my client uses for settling their FX trades.
©2006 Marc Adler - All Rights Reserved

CLS is a bank set up by a consortium of different financial firms. It what my client uses for settling their FX trades.
©2006 Marc Adler - All Rights Reserved
Services for the Wall Street Stack
I have blogged before about the need for a standardized Wall Street Stack. At my current client, there are several different frameworks that have been built over the years, but no framework has gained enterprise-wide acceptance.
These are the services that are generally needed for a complete application framework. If you can think of any other, let me know.
Authentication - logging in to various databases, web servers, internal systems, etc. Best implemented through an enterprise-wide authentication service (using the user's Kerberos token, etc)
Authorization (Entitlements) - what actions can a user perform within an application and what data is a user entitled to see. Best accomplished through an enterprise-wide system.
Logging - log interesting things that happen in an application. Log4Net is a good framework.
User Preferences - load and save the state of the UI
User Data - each application may want to persist the last state of the application when the user logged off
Configuration - Each application should be configurable through a series of XMl files.
General Services Manager - drives the entire service locator framework
Applet Management - load applets from .NET assemblies
Internal Event Broker - lightweight communication between applets
Data and Persistence layer - ways to load, query, update and cache data. Should be configurable so that we can go through different transport layers
Service Agents - processed async notifications that come to us through subscriptions.
Shell - handles initialization of the application, calls all of the various services, provides presentation services for the applets
UI - menu manager, status bar manager, navbar manager, toolbar manager
Security/Cryptography - does the data need to be encrypted and decrypted? (passwords, sensitive data)
Exception Handling - provides a unified way of handling errors that occur in shell and the various applets
Threading - model for async processing
©2006 Marc Adler - All Rights Reserved
These are the services that are generally needed for a complete application framework. If you can think of any other, let me know.
Authentication - logging in to various databases, web servers, internal systems, etc. Best implemented through an enterprise-wide authentication service (using the user's Kerberos token, etc)
Authorization (Entitlements) - what actions can a user perform within an application and what data is a user entitled to see. Best accomplished through an enterprise-wide system.
Logging - log interesting things that happen in an application. Log4Net is a good framework.
User Preferences - load and save the state of the UI
User Data - each application may want to persist the last state of the application when the user logged off
Configuration - Each application should be configurable through a series of XMl files.
General Services Manager - drives the entire service locator framework
Applet Management - load applets from .NET assemblies
Internal Event Broker - lightweight communication between applets
Data and Persistence layer - ways to load, query, update and cache data. Should be configurable so that we can go through different transport layers
Service Agents - processed async notifications that come to us through subscriptions.
Shell - handles initialization of the application, calls all of the various services, provides presentation services for the applets
UI - menu manager, status bar manager, navbar manager, toolbar manager
Security/Cryptography - does the data need to be encrypted and decrypted? (passwords, sensitive data)
Exception Handling - provides a unified way of handling errors that occur in shell and the various applets
Threading - model for async processing
©2006 Marc Adler - All Rights Reserved
Universal DBs
Lately, I have been talking with IT directors at various financial firms. There seems to be one consistent message --- The holy grail that all of the financial firms are seeking is the universal database, where all trades across all asset classes can be held.
This is especially problematic at financial firms who keep buying other firms (Wachovia, Bank of America).
OLAP is a hot skill right now, and companies what to perform sophisticated queries over huge amounts of data. Finetix currently is working in the OLAP space int he commodities area of a major financial firm. This firm has asked Finetix to invent a cloning machine so we duplicate our 3 OLAP stars and sprinkle them throughout the firm. Maybe I should start attending Andrew Brust's presentations at the various .NET user groups.
©2006 Marc Adler - All Rights Reserved
This is especially problematic at financial firms who keep buying other firms (Wachovia, Bank of America).
OLAP is a hot skill right now, and companies what to perform sophisticated queries over huge amounts of data. Finetix currently is working in the OLAP space int he commodities area of a major financial firm. This firm has asked Finetix to invent a cloning machine so we duplicate our 3 OLAP stars and sprinkle them throughout the firm. Maybe I should start attending Andrew Brust's presentations at the various .NET user groups.
©2006 Marc Adler - All Rights Reserved
Sunday, May 14, 2006
How Do They Find Me?
I have been getting a bunch of calls from recruiters at my desk at my current client. I think that they know the telephone prefixes of the IT departments at the various Wall Street companies. The recruiters call every single number with that prefix in the middle of the night, and wait for the voice mail to kick in. So, they can get a name of a person at a desk at a Wall Street company.
The calls then come....
Recruiter : Hi Marc. I know someone who worked with you at your last company and they thought you were great.
Me (seeing the bullshit form a mile away) : That's fantastic! What company was that?
Recruiter : (sound of frantic typing in the background). Did you say that this was Marc Adler? Hmmm... it was ... XYZ.
Me : Who was the person that referred you?
Recruiter : Let me tell you about this position.
Me : (hangs up)
A recruiter's opening line says everything about his veracity and ethics. If a recruiter comes across like a telemarketer, I will not deal with him. A better line might be :
Recruiter : Hi Marc. I have been retained by Bank of America to hire a team that needs to build a credit derivatives system. Their platform will be a .NET front end, Java backend, wired together by Tibco EMS. Since you are working now for XYZ, and since I know that their credit derivatives systems use that precise technology, I was wondering if you or any of your teammates would be interesting in implementing a system like this over at BofA. Of course, the compensation would be above and beyond your current salary, which given your level, I could probably take a guess at.
Why is this good? I find out the name of the company who is hiring, and I already know that it's not with the company that I am currently with. (The worst thing is to find out that the job is for your position at your current company!). I see that the recruiter has taken the time to find out that I am with the credit derivs area, and has taken the time to know that my current client uses a particular technology. I see that the recruiter is aware of current salaries and could divine what it would take for an established player to move to another company.
I don't want to have to play games with a recruiter to find out about a position. Be straight, be honest. If I am truly interested in something, then I will not do an end-run around you.
Also, do you guys realize that, if you call me in the middle of the day, then the 5 people who sit around me usually hang on every word that I say on the phone?
©2006 Marc Adler - All Rights Reserved
The calls then come....
Recruiter : Hi Marc. I know someone who worked with you at your last company and they thought you were great.
Me (seeing the bullshit form a mile away) : That's fantastic! What company was that?
Recruiter : (sound of frantic typing in the background). Did you say that this was Marc Adler? Hmmm... it was ... XYZ.
Me : Who was the person that referred you?
Recruiter : Let me tell you about this position.
Me : (hangs up)
A recruiter's opening line says everything about his veracity and ethics. If a recruiter comes across like a telemarketer, I will not deal with him. A better line might be :
Recruiter : Hi Marc. I have been retained by Bank of America to hire a team that needs to build a credit derivatives system. Their platform will be a .NET front end, Java backend, wired together by Tibco EMS. Since you are working now for XYZ, and since I know that their credit derivatives systems use that precise technology, I was wondering if you or any of your teammates would be interesting in implementing a system like this over at BofA. Of course, the compensation would be above and beyond your current salary, which given your level, I could probably take a guess at.
Why is this good? I find out the name of the company who is hiring, and I already know that it's not with the company that I am currently with. (The worst thing is to find out that the job is for your position at your current company!). I see that the recruiter has taken the time to find out that I am with the credit derivs area, and has taken the time to know that my current client uses a particular technology. I see that the recruiter is aware of current salaries and could divine what it would take for an established player to move to another company.
I don't want to have to play games with a recruiter to find out about a position. Be straight, be honest. If I am truly interested in something, then I will not do an end-run around you.
Also, do you guys realize that, if you call me in the middle of the day, then the 5 people who sit around me usually hang on every word that I say on the phone?
©2006 Marc Adler - All Rights Reserved
Interesting Call From Microsoft Recruiting
It used to be where millions of applicants would send their resumes to Microsoft in hopes of a job. Howver, this is not your father's Microsoft anymore. The stock has been in the shitter for the past few years (I sold mine for a split-adjusted price of $30 in 2001, and the stock has never gotten higher), and the options program has been dessimated.
Somehow, a Microsoft recruiter got a hold of my name from some past colleague. There is a developer evangalist position open in the New York/New Jersey area. I happen to know the person who just left that position; he had been a familiar face at the various New Jersey .NET User Group meetings. This is not a bad position .... you get to go to companies and user groups around the NYC/NJ area and talk about the latest MS technologies from a developer perspective.
So, this recruiter kept calling and calling. I was not interested in the position at all, but I wanted to get another data point and hear what MS was offering senior-level architects and devs now. She would call me in the middle of the day, at my desk at my client, and I would patiently explain to her that I could not talk about a new job with 5 people sitting around me. She would make plans to call me in the evening, but then had to go pick up her kids somewhere, watch her neighbor's kids, etc. Always some excuse.
We finally managed to connect this week. She started to explain the job to me, but I told her that I was already very familiar with the responsibilities of the position. I told her to get down to brass tacks. What were they paying? I told her what my current base salary was so that we could start negotiating. My hopes would be that she could come close to the base,
She looked in her little black book, muttered to herself "hmmm... since this IS in the New York area, we have to give you a boost in the base", and came up with a number that is about 40% less than what I am making in base salary now.
To top it off, she then asked me why I would leave my current position for one that paid 40% less. This got me a bit steamed. I told her that:
a) It was YOU who have been persuing me, not the other way around. I never said anything about wanting to leave my current position.
b) I would NEVER leave for 40% less, unless it was topped off by outright stock grants that would raise my total comp to a figure that was way over the base (something that they will not guarantee for this position).
c) I told her that I was an avid reader of the Mini-Microsoft blog (she said something like "Oh No!"), and that under the current conditions at Microsoft, I don't think that I would be interested in subjecting myself to that type of lifestyle. In addition, I was not interested in interviewing with some 25-year old pisher who would be asking me logic questions like "How Do You Move Mount Fuji?".
She asked me if I had any colleagues who would be interested, whereby I replied that all of my colleagues who might be interested were making a lot more money than you just offered. I told her that I would never consider at MS until there was evidence of a complete culture change and/or there was sustained upwards movement in the stock price. I told her that she should study Mini-Microsoft very carefully, and note the exodus from her her company.
What an amazing turnaround for the prestige of Microsoft, a company that I used to admire. I consulted for MS for 3 years back from 198901992, writing the first front end for SQL Server. My former MS manager is a group VP, and is a millionaire many times over. But, I am afraid that most of the bright lights there have now been dimmed.
©2006 Marc Adler - All Rights Reserved
Somehow, a Microsoft recruiter got a hold of my name from some past colleague. There is a developer evangalist position open in the New York/New Jersey area. I happen to know the person who just left that position; he had been a familiar face at the various New Jersey .NET User Group meetings. This is not a bad position .... you get to go to companies and user groups around the NYC/NJ area and talk about the latest MS technologies from a developer perspective.
So, this recruiter kept calling and calling. I was not interested in the position at all, but I wanted to get another data point and hear what MS was offering senior-level architects and devs now. She would call me in the middle of the day, at my desk at my client, and I would patiently explain to her that I could not talk about a new job with 5 people sitting around me. She would make plans to call me in the evening, but then had to go pick up her kids somewhere, watch her neighbor's kids, etc. Always some excuse.
We finally managed to connect this week. She started to explain the job to me, but I told her that I was already very familiar with the responsibilities of the position. I told her to get down to brass tacks. What were they paying? I told her what my current base salary was so that we could start negotiating. My hopes would be that she could come close to the base,
She looked in her little black book, muttered to herself "hmmm... since this IS in the New York area, we have to give you a boost in the base", and came up with a number that is about 40% less than what I am making in base salary now.
To top it off, she then asked me why I would leave my current position for one that paid 40% less. This got me a bit steamed. I told her that:
a) It was YOU who have been persuing me, not the other way around. I never said anything about wanting to leave my current position.
b) I would NEVER leave for 40% less, unless it was topped off by outright stock grants that would raise my total comp to a figure that was way over the base (something that they will not guarantee for this position).
c) I told her that I was an avid reader of the Mini-Microsoft blog (she said something like "Oh No!"), and that under the current conditions at Microsoft, I don't think that I would be interested in subjecting myself to that type of lifestyle. In addition, I was not interested in interviewing with some 25-year old pisher who would be asking me logic questions like "How Do You Move Mount Fuji?".
She asked me if I had any colleagues who would be interested, whereby I replied that all of my colleagues who might be interested were making a lot more money than you just offered. I told her that I would never consider at MS until there was evidence of a complete culture change and/or there was sustained upwards movement in the stock price. I told her that she should study Mini-Microsoft very carefully, and note the exodus from her her company.
What an amazing turnaround for the prestige of Microsoft, a company that I used to admire. I consulted for MS for 3 years back from 198901992, writing the first front end for SQL Server. My former MS manager is a group VP, and is a millionaire many times over. But, I am afraid that most of the bright lights there have now been dimmed.
©2006 Marc Adler - All Rights Reserved
Monday, May 01, 2006
What I am doing now
At my new client, one of the Tier-1 IBs on Wall Street, I am now in charge of a FX Exception Processing System. What this system does is allow FX Operations to examine and fix any FX trades which did not go through for one reason or another.
The front end is all C#/.NET, communicating with a Java trade engine using both Web Services and a home-grown XML message broker. Sybase is the database, and from the backend, connectivity is to both CLS and to SWIFTNet.
The GUI uses the Infragistics toolset, and is very grid-intensive. The real-time element is not crucial, and the trade volume is light enough so that we do not have to consider switching to the SyncFusion grid right now.
Any FX Trade Events (in this system, notification of a broken trade is called an 'event') that occur are sent from the backend to our GUI using the message broker. All FX Trades are also sent to our GUI. If the trade that comes in matches a filter criteria that is set up in one of the grids, then the trade is updated (or, in some events, the trade is deleted from the grid).
As more and more groups come on line and use our system, we will be runing into scalability issues. For example, let's say that you have a grid open that is monitoring all trades that occur today. Let's also say that no filtering criteria is set up, other than the fact that you want to look at today's trades. This means that every new trade will be inserted into the top of the grid. This is OK for now, as the trade volume is relatively light. But, more groups have expressed using our GUI. We anticipate that, by the end of the year, we might experience 10x the volume we have now.
I am going to be writing some stress-testing tools that will help us analyze the possible impact of other groups using our system. More on this later.
©2006 Marc Adler - All Rights Reserved
The front end is all C#/.NET, communicating with a Java trade engine using both Web Services and a home-grown XML message broker. Sybase is the database, and from the backend, connectivity is to both CLS and to SWIFTNet.
The GUI uses the Infragistics toolset, and is very grid-intensive. The real-time element is not crucial, and the trade volume is light enough so that we do not have to consider switching to the SyncFusion grid right now.
Any FX Trade Events (in this system, notification of a broken trade is called an 'event') that occur are sent from the backend to our GUI using the message broker. All FX Trades are also sent to our GUI. If the trade that comes in matches a filter criteria that is set up in one of the grids, then the trade is updated (or, in some events, the trade is deleted from the grid).
As more and more groups come on line and use our system, we will be runing into scalability issues. For example, let's say that you have a grid open that is monitoring all trades that occur today. Let's also say that no filtering criteria is set up, other than the fact that you want to look at today's trades. This means that every new trade will be inserted into the top of the grid. This is OK for now, as the trade volume is relatively light. But, more groups have expressed using our GUI. We anticipate that, by the end of the year, we might experience 10x the volume we have now.
I am going to be writing some stress-testing tools that will help us analyze the possible impact of other groups using our system. More on this later.
©2006 Marc Adler - All Rights Reserved
Comings and Goings
In the United States, men are glued to their TV sets, watching the National Football League's annual college draft. This is the time when 26 football teams throw a ridiculous amount of money at elite college atheletes.
On Wall Street, the annual post-bonus dance is almost complete. As people received their bonus checks in February or March, news comes almost every day that this person or that person has departed for company X or Y. This has dessimated several's company's IT departments, as the one person who knows a certain application inside and out is suddenly no more .... and the mad scramble for talent starts anew as companies try to backfill these positions.
(Wall Street is very small ... never burn your bridges.)
Just like the NFL draft, those of us in Wall Street IT sit back and await news to see where our colleagues end up. Such is the situation with me. I sit back and monitor the blogs, anxiously waiting to see where Matt, Pin, and Deglan end up. Matt announced his resignation on his blog, and invited all comers to bid on his services. In his last blog post, he said that he had many offers from his blog readers. Whoever the lucky company is who ends up with Matt, it will be money well spent.
The bar has been raised slightly in terms of compensation packages for senior developers. On Wall Street, a total compensation package of slightly over $200K is becoming more common. The calls from headhunters are becoming more frantic, as Wall Street scrambles to fill positions of their dearly departed developers. The base salary seems to still be $150K, but on Wall Street, bonus is everything. Managing Directors typically make 200-300% in bonus. Developers are still in the 30-40% range in most companies,except for the premier companies, where your 18-hour days might get you upwards of 80%. But, as a colleague of mine told me recently, many a marriage has been sacrificed in exchange for that bonus.
©2006 Marc Adler - All Rights Reserved
On Wall Street, the annual post-bonus dance is almost complete. As people received their bonus checks in February or March, news comes almost every day that this person or that person has departed for company X or Y. This has dessimated several's company's IT departments, as the one person who knows a certain application inside and out is suddenly no more .... and the mad scramble for talent starts anew as companies try to backfill these positions.
(Wall Street is very small ... never burn your bridges.)
Just like the NFL draft, those of us in Wall Street IT sit back and await news to see where our colleagues end up. Such is the situation with me. I sit back and monitor the blogs, anxiously waiting to see where Matt, Pin, and Deglan end up. Matt announced his resignation on his blog, and invited all comers to bid on his services. In his last blog post, he said that he had many offers from his blog readers. Whoever the lucky company is who ends up with Matt, it will be money well spent.
The bar has been raised slightly in terms of compensation packages for senior developers. On Wall Street, a total compensation package of slightly over $200K is becoming more common. The calls from headhunters are becoming more frantic, as Wall Street scrambles to fill positions of their dearly departed developers. The base salary seems to still be $150K, but on Wall Street, bonus is everything. Managing Directors typically make 200-300% in bonus. Developers are still in the 30-40% range in most companies,except for the premier companies, where your 18-hour days might get you upwards of 80%. But, as a colleague of mine told me recently, many a marriage has been sacrificed in exchange for that bonus.
©2006 Marc Adler - All Rights Reserved
Saturday, April 29, 2006
College Admissions
I just returned from a trip to California with my son. We have just started to look at colleges for him. He is a junior in high school, but this is when kids start considering colleges seriously. We went to see U Cal at Berkeley, Stanford, and Pomona. All three very different colleges.
Warning to parents: good grades and good standardized test scores just don't cut it anymore. Stanford rejects an awful lot of kids who get 1600's on their SATs. All of the colleges want to see rigorous courses in high school, great grades, great SAT I and SAT II and AP/IB scores. But they also want students that are unique in some way. The essays that kids have to write for their college applications are extremely important.
It is not only amazing difficult to get into the top-tier schools. It is also getting increasing difficult to get into the upper-middle tier schools. Applications are skewed by professional college counselors who you can hire for $10,000 to $30,000 .... you wonder if a kid gets into a certain college because of his/her own worth, or because daddy's paycheck is fat enough to hire a pro.
Now, we have to capture the one big intangible that my son has into an essay .. the fact that he is a leader ... not in the academic sense (ie: he is not the editor of the school newspaper nor the quarterback of his school's football team) ... but the fact that he has packs of kids that follow him around, that kids are constantly calling him and messaging him, that he can snap his fingers and a whole cadre of students will appear to schlep his drumset from gig to gig. In other words, someone who has that special magnetism that command attention amongst his peers (think Tony Soprano).
I wonder if Stanford is interested in the future leader of La Cosa Nostra.....
(To the British readers here .. does the same thing apply to Oxford and Cambridge? Is most of the UK clamoring to get into these two schools?)
©2006 Marc Adler - All Rights Reserved
Warning to parents: good grades and good standardized test scores just don't cut it anymore. Stanford rejects an awful lot of kids who get 1600's on their SATs. All of the colleges want to see rigorous courses in high school, great grades, great SAT I and SAT II and AP/IB scores. But they also want students that are unique in some way. The essays that kids have to write for their college applications are extremely important.
It is not only amazing difficult to get into the top-tier schools. It is also getting increasing difficult to get into the upper-middle tier schools. Applications are skewed by professional college counselors who you can hire for $10,000 to $30,000 .... you wonder if a kid gets into a certain college because of his/her own worth, or because daddy's paycheck is fat enough to hire a pro.
Now, we have to capture the one big intangible that my son has into an essay .. the fact that he is a leader ... not in the academic sense (ie: he is not the editor of the school newspaper nor the quarterback of his school's football team) ... but the fact that he has packs of kids that follow him around, that kids are constantly calling him and messaging him, that he can snap his fingers and a whole cadre of students will appear to schlep his drumset from gig to gig. In other words, someone who has that special magnetism that command attention amongst his peers (think Tony Soprano).
I wonder if Stanford is interested in the future leader of La Cosa Nostra.....
(To the British readers here .. does the same thing apply to Oxford and Cambridge? Is most of the UK clamoring to get into these two schools?)
©2006 Marc Adler - All Rights Reserved
Event Manager Code - Possible Enhancements
Now that I have posted the code for the Event Manager that I have used in several projects, I would like to list some possible enhancements that I have considered:
Precompile regular expressions
The Event Manager supports wildcards. The .NET RegularExpression classes are used to perform matching of a published topic with a wildcarded subscription. Howver, I do not pre-compile the regexps. This is a very simple change to make.
Enhanced regular expressions
We can expand the regular expressions that wildcarded subscriptions will accept. For example, to subscribe to an insert or delete action for a trade, we should be able to have a wildcard topic that looks like this:
Magmasystems.TradingSystem.Trade.[InsertedDeleted]
Stronger typing of args for event declarations
The third argument of EventManager.Fire() is anything that derives from EventManagerArgs. We can add more type safety by specifying the subclass of EventManagerArgs that a publisher expects to send and that the corresponding subscribers expect to receive.
Scoping
Microsoft's CAB has the notion of event scoping. We can limit a published event to subscribers that run in the same thread (or a certain thread) as the publisher. We can limit the scope to a named "applet". Otherwise, by default, the event is published globally.
EventManager.Register(this)
I am not totally thrilled with the fact that, for every object that publishes or subscribes, a call to EventManager.Register(this) is called. The Register() function will examine the passed class, using reflection on the class to build up a dictionary of publishers and subscribers to a topic.
Dynamically register the publisher and subscriber
Instead of using the static way of decorating a method, we may want to add publications and subscriptions dynamically. For instance, we should be able to say something liek this:
EventManager.Subscribe("Magmasystems.TradingSystem.Trade.*", this.OnTradeEvent);
Sinks for event publishing
Implement Sinks so a class can have a crack at an event args before it is sent to the subscribers.
©2006 Marc Adler - All Rights Reserved
Precompile regular expressions
The Event Manager supports wildcards. The .NET RegularExpression classes are used to perform matching of a published topic with a wildcarded subscription. Howver, I do not pre-compile the regexps. This is a very simple change to make.
Enhanced regular expressions
We can expand the regular expressions that wildcarded subscriptions will accept. For example, to subscribe to an insert or delete action for a trade, we should be able to have a wildcard topic that looks like this:
Magmasystems.TradingSystem.Trade.[InsertedDeleted]
Stronger typing of args for event declarations
The third argument of EventManager.Fire() is anything that derives from EventManagerArgs. We can add more type safety by specifying the subclass of EventManagerArgs that a publisher expects to send and that the corresponding subscribers expect to receive.
Scoping
Microsoft's CAB has the notion of event scoping. We can limit a published event to subscribers that run in the same thread (or a certain thread) as the publisher. We can limit the scope to a named "applet". Otherwise, by default, the event is published globally.
EventManager.Register(this)
I am not totally thrilled with the fact that, for every object that publishes or subscribes, a call to EventManager.Register(this) is called. The Register() function will examine the passed class, using reflection on the class to build up a dictionary of publishers and subscribers to a topic.
Dynamically register the publisher and subscriber
Instead of using the static way of decorating a method, we may want to add publications and subscriptions dynamically. For instance, we should be able to say something liek this:
EventManager.Subscribe("Magmasystems.TradingSystem.Trade.*", this.OnTradeEvent);
Sinks for event publishing
Implement Sinks so a class can have a crack at an event args before it is sent to the subscribers.
©2006 Marc Adler - All Rights Reserved
Friday, April 28, 2006
Event Manager Code - EventManager.cs
Here is the code for the main EventManager class.
There are a number of ways that I would like to improve the code, but just never have had the time. When I get a few free moments, I will discuss some of the enhancements that I would like to put in the code eventually.
©2006 Marc Adler - All Rights Reserved
There are a number of ways that I would like to improve the code, but just never have had the time. When I get a few free moments, I will discuss some of the enhancements that I would like to put in the code eventually.
// for MethodImplAttrbute
using System;
using System.Collections;
using System.ComponentModel;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
// for ISynchronizer
// --------------------------------------------------------------------
//
// This code is (C) Copyright 2005 Marc Adler
//
// --------------------------------------------------------------------
namespace Magmasystems.EventManager
{
public delegate bool EventManagerEventHandler(object sender, string topicName, EventArgs e);
public class EventManager
{
#region Delegates
// Internal delegate used to help us fire async events
private delegate void AsyncFire(Delegate del, object[] args);
#endregion
#region Variables
// The singleton EventManager
private static EventBroker _theEventManager = null;
// A Dictionary of EventManagerEventInfo classes, indexed by the topic name
private Hashtable _theEventDictionary = null;
private Hashtable _theWildcardSubscribers = null;
// Used to disabled and re-enable the firing of events
private bool _isEnabled = true;
#endregion
#region Constructors and Static Instance
protected EventBroker()
{
}
// This is the way that the EventManager singleton is accessed
static public EventManager Instance
{
get
{
if(_theEventManager == null)
{
_theEventManager = new EventBroker();
_theEventManager._theEventDictionary = new Hashtable();
_theEventManager._theWildcardSubscribers = new Hashtable();
_theEventManager._isEnabled = true;
}
return _theEventManager;
}
}
#endregion
#region Properties
private Hashtable Dictionary
{
get
{
// make sure that the dictionary and event manager are instantiated
return _theEventDictionary;
}
}
private Hashtable WildcardDictionary
{
get
{
// make sure that the dictionary and event manager are instantiated
return _theWildcardSubscribers;
}
}
public bool Enabled
{
get { return this._isEnabled; }
set { this._isEnabled = value; }
}
#endregion
#region General Methods
static public void Register(object o)
{
Type type = o.GetType();
MethodInfo[] methods = type.GetMethods();
foreach (MethodInfo mi in methods)
{
// if(mi.DeclaringType != type)
// continue;
object[] oAttrs = mi.GetCustomAttributes(true);
foreach (object oAttr in oAttrs)
{
EventManagerEventInfo evInfo;
if(oAttr is EventSubscriberAttribute)
{
EventSubscriberAttribute evSubAttr = oAttr as EventSubscriberAttribute;
evInfo = FindTopicEntry(evSubAttr.Topic, true);
if(evInfo != null)
{
EventSubscriberInfo subInfo = evInfo.AddSubscriber(evSubAttr.Topic, o, evSubAttr.IsBackground, mi);
if(subInfo.HasWildcards)
{
EventBroker.Instance._theWildcardSubscribers[evSubAttr.Topic] = evInfo;
}
}
}
else if(oAttr is EventPublisherAttribute)
{
EventPublisherAttribute evPubAttr = oAttr as EventPublisherAttribute;
evInfo = FindTopicEntry(evPubAttr.Topic, true);
if(evInfo != null)
{
evInfo.AddPublisher(evPubAttr.Topic, o);
}
}
}
}
}
static private EventManagerEventInfo FindTopicEntry(string topicName, bool createIfEmpty)
{
EventManagerEventInfo evInfo ;
topicName = topicName.ToUpper();
object oEventInfo = EventBroker.Instance._theEventDictionary[topicName];
if(oEventInfo == null)
{
if(createIfEmpty)
{
// Allocate a new entry
evInfo = new EventManagerEventInfo();
EventBroker.Instance.Dictionary[topicName] = evInfo;
}
else
{
evInfo = null;
}
}
else
{
// Use the existing entry
evInfo = oEventInfo as EventManagerEventInfo;
}
return evInfo;
}
#endregion
#region Ways to Fire and Event
[MethodImpl(MethodImplOptions.NoInlining)]
static public void Fire(object sender, string topicName, EventArgs args)
{
if (EventBroker.Instance.Enabled == false)
return;
EventManagerEventInfo evInfo = FindTopicEntry(topicName, false);
if(evInfo != null)
{
evInfo.Fire(sender, topicName, args);
}
foreach (object oKey in EventBroker.Instance._theWildcardSubscribers.Keys)
{
string keyName = oKey as String;
Regex regExp = new Regex(keyName, RegexOptions.IgnoreCase);
if(regExp.IsMatch(topicName))
{
evInfo = EventBroker.Instance._theWildcardSubscribers[oKey] as EventManagerEventInfo;
evInfo.Fire(sender, topicName, args);
}
}
}
#endregion
#region Inner Class for EventManagerEventInfo
///
/// EventManagerEventInfo
/// This class represents information about a single event
///
public class EventManagerEventInfo
{
#region Variables
// Multicast delegate of all subcribers to this event
private event EventManagerEventHandler _eventHandler;
// The list of classes that publish this event
private ArrayList _publishers;
// The list of classes that subscribe to this event
private ArrayList _subscribers;
#endregion
#region Constructors
public EventManagerEventInfo()
{
this._publishers = new ArrayList();
this._subscribers = new ArrayList();
this._eventHandler = null;
}
#endregion
#region Events
public event EventManagerEventHandler EventManagerEvent
{
add { this._eventHandler += value; }
remove { this._eventHandler -= value; }
}
#endregion
#region Properties
public EventManagerEventHandler EventHandler
{
get { return this._eventHandler; }
}
public ArrayList Publishers
{
get { return this._publishers; }
}
public ArrayList Subscribers
{
get { return this._subscribers; }
}
#endregion
#region Methods
public EventSubscriberInfo AddSubscriber(string topicName, object objectRef, bool isBackground, MethodInfo mi)
{
EventSubscriberInfo subInfo = new EventSubscriberInfo(this, topicName, objectRef, isBackground, mi);
this._eventHandler += new EventManagerEventHandler(subInfo.OnPublisherFired);
this.Subscribers.Add(subInfo);
return subInfo;
}
public EventPublisherInfo AddPublisher(string topicName, object objectRef)
{
EventPublisherInfo pubInfo = new EventPublisherInfo(this, topicName, objectRef);
this.Publishers.Add(pubInfo);
return pubInfo;
}
public void RemoveSubscriber(EventSubscriberInfo sub)
{
this.Subscribers.Remove(sub);
}
public void RemovePublisher(EventPublisherInfo pub)
{
this.Publishers.Remove(pub);
}
#endregion
#region Event Firing
public void Fire(object sender, string topicName, EventArgs args)
{
// This handles the event firing to the SubscriberInfo class. In turn, the
// SubscriberInfo object will invoke the actual delegate. The SubscriberInfo
// object will determine whether the delegate shoul dbe called synchronously
// or asynchronously.
if(this.EventHandler != null)
{
this.EventHandler(sender, topicName, args);
}
}
#endregion
}
#endregion
#region Inner class for EventPublisherInfo
public class EventPublisherInfo
{
#region Variables
private EventManagerEventInfo _evInfo;
private WeakReference _objectRef;
private string _topicName; // the upper-cased name
private string _displayName; // used to generate context menus at runtime
#endregion
#region Constructors
private EventPublisherInfo()
{
this._objectRef = null;
}
public EventPublisherInfo(EventManagerEventInfo evInfo, string topicName) : this()
{
this._evInfo = evInfo;
this.DisplayName = topicName;
this._topicName = topicName.ToUpper();
}
public EventPublisherInfo(EventManagerEventInfo evInfo, string topicName, object objectRef) : this(evInfo, topicName)
{
this._objectRef = new WeakReference(objectRef);
}
#endregion
#region Properties
public WeakReference Publisher
{
get { return (this._objectRef.IsAlive == true) ? this._objectRef : null; }
set { this._objectRef = value; }
}
public string DisplayName
{
get { return this._displayName; }
set { this._displayName = value; }
}
#endregion
}
#endregion
#region Inner class for EventSubscriberInfo
public class EventSubscriberInfo
{
#region Variables
private EventManagerEventInfo _eventInfo; // ref back to the holding container
private WeakReference _objectRef;
private MethodInfo _methodInfo; // The method that the event firer should Invoke
private bool _isBackground;
private EventManagerEventHandler _delegateForAsync;
private string _topicName; // we may have wildcards
private bool _hasWildcards; // to help determine whether to use RegEx or not
#endregion
#region Constructors
private EventSubscriberInfo()
{
this._objectRef = null;
this._isBackground = false;
this._hasWildcards = false;
}
public EventSubscriberInfo(EventManagerEventInfo evInfo, string topicName) : this()
{
this._eventInfo = evInfo;
this.TopicName = topicName; // use the property so that formatting is done
}
public EventSubscriberInfo(EventManagerEventInfo evInfo, string topicName, object objectRef) : this(evInfo, topicName)
{
this._objectRef = new WeakReference(objectRef);
}
public EventSubscriberInfo(EventManagerEventInfo evInfo, string topicName, object objectRef, bool isBackground, MethodInfo mi) : this(evInfo, topicName, objectRef)
{
this._isBackground = isBackground;
this._methodInfo = mi;
if(isBackground)
{
this._delegateForAsync = (EventManagerEventHandler) Delegate.CreateDelegate(typeof (EventManagerEventHandler), objectRef, mi.Name);
}
}
#endregion
#region Properties
public object Subscriber
{
get { return (this._objectRef.IsAlive) ? this._objectRef.Target : null; }
}
public bool IsBackground
{
get { return this._isBackground; }
set { this._isBackground = value; }
}
public string TopicName
{
get { return this._topicName; }
set { this._topicName = FormatTopicName(value); }
}
public bool HasWildcards
{
get { return this._hasWildcards; }
}
#endregion
#region Methods
private string FormatTopicName(string topic)
{
// We want to make things easy for matching publishers and sunscribers.
// 1) We always use upper-case topic names.
// 2) Replace the dots with slashes so that the dot is not taken as a regexp
// character by the pattern matcher.
// 3) Let us know whether this topic has a wildcard in it so we know whether
// to use the slow regexp matcher or the faster Equals operator.
if(topic.IndexOfAny(new char[] {'*'}) >= 0)
this._hasWildcards = true;
return topic.Replace('.', '/').ToUpper();
}
#endregion
#region Event Firing
///
/// This gets called whenever the event manager fires an event.
/// This does the hard work in event firing. It eventually calls
/// the subscriber's delegate in order to process the event. it also determines
/// whether the delegate should be called synchronously or asynchronously.
///
///
///
///
///
//
public bool OnPublisherFired(object sender, string topicName, EventArgs args)
{
// If the object that this subscriber is bound to has been garbage-collected, then
// remove the subscriber from the EventInfo's subscriber list and return.
if(this.Subscriber == null)
{
this._eventInfo.RemoveSubscriber(this);
return true;
}
if(this.IsBackground)
{
AsyncFire asyncFire = new AsyncFire(InvokeDelegate);
asyncFire.BeginInvoke(this._delegateForAsync, new object[] {sender, topicName, args}, new AsyncCallback(Cleanup), null);
}
else
{
object oRet = this._methodInfo.Invoke(this.Subscriber, new object[] {sender, topicName, args});
if(oRet is Boolean)
return (bool) oRet;
}
return true;
}
private void InvokeDelegate(Delegate del, object[] args)
{
ISynchronizeInvoke synchronizer = del.Target as ISynchronizeInvoke;
if(synchronizer != null) // Requires thread affinity
{
if(synchronizer.InvokeRequired)
{
synchronizer.Invoke(del, args);
return;
}
}
// Not requiring thread afinity or invoke is not required
del.DynamicInvoke(args);
}
private void Cleanup(IAsyncResult asyncResult)
{
asyncResult.AsyncWaitHandle.Close();
}
#endregion
}
#endregion
}
}
©2006 Marc Adler - All Rights Reserved
Event Manager Code - EventManagerArgs.cs
These are two minor argument classes that are used to send information from the event publisher to the subscriber. The args are sent as the third parameter in the EventManager.Fire() function.
©2006 Marc Adler - All Rights Reserved
using System;
namespace Magmasystems.EventManager
{
///
/// Summary description for EventManagerArgs.
///
public class EventManagerArgs : EventArgs
{
public EventManagerArgs()
{
}
}
// This is used to pass string data between the publisher and subscriber
public class EventManagerMessageArgs : EventManagerArgs
{
private string _message;
public EventManagerMessageArgs(string msg)
{
this._message = msg;
}
public string Message
{
get { return this._message; }
}
}
}
©2006 Marc Adler - All Rights Reserved
Event Manager Code - EventSubscriberAttribute.cs
The EventSubscriberAttribute is used to decorate a C# function that is the recipient of a subscribed event from our event manager. The topic name can be a wildcard string, just like Tibco. For instance, to subscribe to all actions that happen to a trade, you can subscribe to topic "TradingSystem.Trade.*".
Notice that the attribute is declared with AllowMultiple=true. This lets a function have multiple subscription declarations.
The final thing to notice is the IsBackground flag. If a subscriber is declared with IsBackground=true, then the event will be dispatched to the subscriber on a worker thread (internally, Begin/EndInvoke is used).
Here is the code:
©2006 Marc Adler - All Rights Reserved
Notice that the attribute is declared with AllowMultiple=true. This lets a function have multiple subscription declarations.
The final thing to notice is the IsBackground flag. If a subscriber is declared with IsBackground=true, then the event will be dispatched to the subscriber on a worker thread (internally, Begin/EndInvoke is used).
Here is the code:
using System;
// --------------------------------------------------------------------
//
// This code is (C) Copyright 2005 Marc Adler
//
// --------------------------------------------------------------------
namespace Magmasystems.EventManager
{
///
/// EventSubscriberAttribute
///
[AttributeUsage(AttributeTargets.Method, AllowMultiple=true)]
public class EventSubscriberAttribute : System.Attribute
{
private string _topicName;
private bool _isBackground;
public EventSubscriberAttribute()
{
}
///
/// EventSubscriberAttribute
///
/// The name of the event
public EventSubscriberAttribute(string topicName)
{
this._topicName = topicName;
this._isBackground = false;
}
public string Topic
{
get
{
return this._topicName;
}
set
{
this._topicName = value;
}
}
public bool IsBackground
{
get
{
return this._isBackground;
}
set
{
this._isBackground = value;
}
}
}
}
©2006 Marc Adler - All Rights Reserved
Event Manager Code - EventPublisherAttribute.cs
The EventPublisherAttribute is a C# attribute that decorates a function that publishes an internal event. Any function that publishes an event out to our little event broker should decorate itself with this attribute.For example:
Here is the code:
©2006 Marc Adler - All Rights Reserved
[EventPublisher("Brokerage.TradingSystem.Trade.ReceivedFromBackend")]
public void OnTradeReceived(Trade trade)
{
.......
EventManager.Fire(this, "Brokerage.TradingSystem.Trade.ReceivedFromBackend",
tradeArgs);
}
Here is the code:
using System;
// --------------------------------------------------------------------
//
// This code is (C) Copyright 2005 Marc Adler
//
// --------------------------------------------------------------------
namespace Magmasystems.EventManager
{
///
/// EventPublisherAttribute
///
public class EventPublisherAttribute : Attribute
{
private string _topicName;
public EventPublisherAttribute()
{
}
///
/// EventPublisherAttribute
///
/// The name of the event
public EventPublisherAttribute(string topicName)
{
this._topicName = topicName;
}
public string Topic
{
get
{
return this._topicName;
}
set
{
this._topicName = value;
}
}
}
}
©2006 Marc Adler - All Rights Reserved
Thursday, April 27, 2006
A Lightweight IntraApp Event Broker for C#/.NET
Over the years, I have managed to write a repository of interesting classes that has helped me in architecting and developing systems. Over the coming months, and as time allows, I will submit some of these classes for your use.
I wrote the EventBroker about two years ago for a trading system that had Tibco connectivity to a message bus that published quotes. I wanted a symmetrical processing model from the back end to the front end, and also, within the front end. So, I wrote a .NET/C#-based lightweight event broker that was like a min-Tibco within the GUI.
The Microsoft CAB has something similar, and when it came out, I took a few ideas from it (such as the handling of WeakReferences) and integrated it into my own Event Broker. CAB differs from mine in several respects .... namely, it has the concept of Event Scope, and it also has a different way of decorating code (it decorates event declarations, while mine decorates methods).
However, this event broker has been used in several trading systems and seems to function well.
In the next several posts, I will post the code of the Event Broker. You are free to use it as long as my copyright is maintained and proper acknowledgement is given. Also, I am anxious to hear of any improvments, enhancements and bug fixes you might make to any of the classes that I publish here. You can always reach me at magmasystems at yahoo dot com.
The Event Broker
The application uses a lightweight Publish/Subscribe (PubSub) model internally in order to notify the controller or UI layer of interesting events. A typical interesting event is a change in the underlying data model.
The mechanism that implements PubSub within the application is called the Event Broker. Event publishers and event subscribers will be automatically registered with the Event Manager by the use of customized .NET attributes.
The use of the Event Manager in no way precludes the application from doing its own event management using the standard .NET event/delegate mechanism.
Using the EventBroker in a class
Any class that wants to use the Pub/Sub capabilities of the EventBroker should do two thing.
1) Include a reference to the EventBroker's assembly. Also, reference the namespace within your class:
using Magmasystems.TradingSystem.EventManager;
2) Register the class with the EventBroker. A good place to do this is in the class' constructor. To register the class with the Event Broker, all that needs to be done is to put in the following line of code:
EventBroker.Register(this);
There are several .NET attributes that can be used to decorate functions in order to define them as either Event Publishers or Event Subscribers. When one of these attributes is constructed, the EventTopic parameter is examined. The EventTopic is added to the EventManager's internal Dictionary. A Dictionary collection is used in order to provide fast access to a particular Topic/Event pairing.
[EventPublisher(string EventTopic)]
This registers a function or class to be an event publisher. The class will publish an event with a specific name. Any subscribers to that topic will be notified.
[EventSubscriber(string EventTopic, options)]
This registers a subscriber to an event. The attribute should be placed directly above the function that will be used as the event handler. The options can be one of the following:
* Background - the handler is called asynchronously
The string-based topic name can be the actual name of a published topic, or it can be a wildcarded topic like "Magmasystems.TradingSystem.Trade.*".
To fire an event, the static method EventManager.Fire() is called
EventManager.Fire(object obj, string eventTopic, EventArgs args);
Event handlers have the signature:
public delegate bool EventManagerEventHandler(object sender,
string topicName, EventArgs e);
Here is a piece of code that publishes an event (The recipient could be a controller that processes events from views and from the models):
[EventPublisher("Magmasystems.TradingSystem.Controller.Action.GetTrades")]
private void GetTrades()
{
GetTradeArgs args = new GetTradeArgs();
args.CUSIP = "12345";
EventBroker.Fire(this, "Barcap.Gcdit.Odc.Controller.Action.GetTrades", args);
}
Here is a piece of code from a controller that subscribes to an event
[EventSubscriber("Magmasystems.TradingSystem.Controller.Action.GetTrades")]
public void GetTrades(object sender, string topicName, System.EventArgs e)
{
GetTradesUnitOfWork.GetTradesArgs args = e as GetTradesUnitOfWork.GetTradesArgs;
if (e == null)
return;
ExecuteAction(new GetTradesUnitOfWork(this._context.UIApplicationContext, args));
}
There is a .Net event associated with every topic that is registered. Events are really Multicast Delegates. Every subscriber to an event adds an event handler to the list of delegates. When an event is fired, the delegate list is traversed and each delegate will be invoked either synchronously or asynchronously. The options can include the Background flag. This tells the event firing mechanism that the underlying delegate should be invoked asynchronously. If the Background flag is not present in the attribute declaration, then the underlying delegate will be invoked synchronously.
Guidelines for Usage
Any class can publish an event, and any class can subscribe to that event. The event bus is global to the entire application.
The line of code that registers a class with the EventBroker is best put in the constructor of the Base Class.
Following our adoption of a namespace convention, we have also adopted a general naming convention for events. This convention is:
companyname.department.application.domainobject.action
©2006 Marc Adler - All Rights Reserved
I wrote the EventBroker about two years ago for a trading system that had Tibco connectivity to a message bus that published quotes. I wanted a symmetrical processing model from the back end to the front end, and also, within the front end. So, I wrote a .NET/C#-based lightweight event broker that was like a min-Tibco within the GUI.
The Microsoft CAB has something similar, and when it came out, I took a few ideas from it (such as the handling of WeakReferences) and integrated it into my own Event Broker. CAB differs from mine in several respects .... namely, it has the concept of Event Scope, and it also has a different way of decorating code (it decorates event declarations, while mine decorates methods).
However, this event broker has been used in several trading systems and seems to function well.
In the next several posts, I will post the code of the Event Broker. You are free to use it as long as my copyright is maintained and proper acknowledgement is given. Also, I am anxious to hear of any improvments, enhancements and bug fixes you might make to any of the classes that I publish here. You can always reach me at magmasystems at yahoo dot com.
The Event Broker
The application uses a lightweight Publish/Subscribe (PubSub) model internally in order to notify the controller or UI layer of interesting events. A typical interesting event is a change in the underlying data model.
The mechanism that implements PubSub within the application is called the Event Broker. Event publishers and event subscribers will be automatically registered with the Event Manager by the use of customized .NET attributes.
The use of the Event Manager in no way precludes the application from doing its own event management using the standard .NET event/delegate mechanism.
Using the EventBroker in a class
Any class that wants to use the Pub/Sub capabilities of the EventBroker should do two thing.
1) Include a reference to the EventBroker's assembly. Also, reference the namespace within your class:
using Magmasystems.TradingSystem.EventManager;
2) Register the class with the EventBroker. A good place to do this is in the class' constructor. To register the class with the Event Broker, all that needs to be done is to put in the following line of code:
EventBroker.Register(this);
There are several .NET attributes that can be used to decorate functions in order to define them as either Event Publishers or Event Subscribers. When one of these attributes is constructed, the EventTopic parameter is examined. The EventTopic is added to the EventManager's internal Dictionary. A Dictionary collection is used in order to provide fast access to a particular Topic/Event pairing.
[EventPublisher(string EventTopic)]
This registers a function or class to be an event publisher. The class will publish an event with a specific name. Any subscribers to that topic will be notified.
[EventSubscriber(string EventTopic, options)]
This registers a subscriber to an event. The attribute should be placed directly above the function that will be used as the event handler. The options can be one of the following:
* Background - the handler is called asynchronously
The string-based topic name can be the actual name of a published topic, or it can be a wildcarded topic like "Magmasystems.TradingSystem.Trade.*".
To fire an event, the static method EventManager.Fire() is called
EventManager.Fire(object obj, string eventTopic, EventArgs args);
Event handlers have the signature:
public delegate bool EventManagerEventHandler(object sender,
string topicName, EventArgs e);
Here is a piece of code that publishes an event (The recipient could be a controller that processes events from views and from the models):
[EventPublisher("Magmasystems.TradingSystem.Controller.Action.GetTrades")]
private void GetTrades()
{
GetTradeArgs args = new GetTradeArgs();
args.CUSIP = "12345";
EventBroker.Fire(this, "Barcap.Gcdit.Odc.Controller.Action.GetTrades", args);
}
Here is a piece of code from a controller that subscribes to an event
[EventSubscriber("Magmasystems.TradingSystem.Controller.Action.GetTrades")]
public void GetTrades(object sender, string topicName, System.EventArgs e)
{
GetTradesUnitOfWork.GetTradesArgs args = e as GetTradesUnitOfWork.GetTradesArgs;
if (e == null)
return;
ExecuteAction(new GetTradesUnitOfWork(this._context.UIApplicationContext, args));
}
There is a .Net event associated with every topic that is registered. Events are really Multicast Delegates. Every subscriber to an event adds an event handler to the list of delegates. When an event is fired, the delegate list is traversed and each delegate will be invoked either synchronously or asynchronously. The options can include the Background flag. This tells the event firing mechanism that the underlying delegate should be invoked asynchronously. If the Background flag is not present in the attribute declaration, then the underlying delegate will be invoked synchronously.
Guidelines for Usage
Any class can publish an event, and any class can subscribe to that event. The event bus is global to the entire application.
The line of code that registers a class with the EventBroker is best put in the constructor of the Base Class.
Following our adoption of a namespace convention, we have also adopted a general naming convention for events. This convention is:
companyname.department.application.domainobject.action
©2006 Marc Adler - All Rights Reserved
Friday, April 14, 2006
Note To Self - Traversing Rows in a Single Band
I am not really a hardcore Infragistics person. I find it amazing that some of the features that I consider essential in their UltraWEBGrid offering are not found in their UltraWINGrid product.
I am writing a prototype of an app that has multiple levels of grouping. I need to be able to double-click on the column header of a band, and have it do something to only the rows in that band. For instance, if the user double-clicks on the column that says 'Selected', then I want every checkbox in that group to be toggled without affecting the rows in any other group.

Sounds easy, right? Find out which header you double-clicked on, and then get the child rows that are associated with that header. The problem is that headers are not considered true rows within UltraWinGrid. They are "UI Elements". They do not have references to the rows that are directly beneath them.
After a while of messing around with the HeaderDoubleClicked event, I finally decided to base my procesing off of the MouseDoubleClick event.
Here is what I finally came up with after a few hours of tinkering around. (By the way, the function 'ToggleSelected' is a good way of walking down the entire tree of rows in a grouped grid.)
It works. The key was the UIElement.GetContext() function, which I finally found by reading a two sentence Knowledge Base article on the Infragistics website.
©2006 Marc Adler - All Rights Reserved
I am writing a prototype of an app that has multiple levels of grouping. I need to be able to double-click on the column header of a band, and have it do something to only the rows in that band. For instance, if the user double-clicks on the column that says 'Selected', then I want every checkbox in that group to be toggled without affecting the rows in any other group.

Sounds easy, right? Find out which header you double-clicked on, and then get the child rows that are associated with that header. The problem is that headers are not considered true rows within UltraWinGrid. They are "UI Elements". They do not have references to the rows that are directly beneath them.
After a while of messing around with the HeaderDoubleClicked event, I finally decided to base my procesing off of the MouseDoubleClick event.
Here is what I finally came up with after a few hours of tinkering around. (By the way, the function 'ToggleSelected' is a good way of walking down the entire tree of rows in a grouped grid.)
private UltraGridRow m_firstRowOfTheHeaderThatWasDoubleClickedOn = null;
private void dgTrades_MouseDoubleClick(object sender, MouseEventArgs e)
{
Infragistics.Win.UIElement element =
this.dgTrades.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y));
if (element != null)
{
this.CalcGridRowForDblClick(element);
if (element is Infragistics.Win.TextUIElement)
{
HeaderBase hdr = element.GetContext(typeof(HeaderBase)) as HeaderBase;
if (hdr != null)
this.dgTrades_DoubleClickHeader(hdr);
}
}
}
private void dgTrades_DoubleClickHeader(HeaderBase hdr)
{
if (hdr.Column.Key == "Selected")
{
if (this.m_firstRowOfTheHeaderThatWasDoubleClickedOn != null)
this.ToggleSelected(e.Header,
this.m_firstRowOfTheHeaderThatWasDoubleClickedOn);
}
this.m_firstRowOfTheHeaderThatWasDoubleClickedOn = null;
}
private void ToggleSelected(HeaderBase header, UltraGridRow row)
{
if (row == null)
return;
UltraGridBand band = header.Band;
UltraGridRow childRow = row.GetChild(ChildRow.First, band);
if (childRow == null)
{
// May be a leaf node
UltraGridColumn colSelected = band.Columns["Selected"];
if (colSelected == null)
return;
int idx = colSelected.Index;
for (; row != null; row = row.GetSibling(SiblingRow.Next, false))
{
row.Cells[idx].Value = !((bool)row.Cells[idx].Value);
}
}
else
{
// Is a non-leaf node
this.ToggleSelected(header, childRow);
this.ToggleSelected(header, row.GetSibling(SiblingRow.Next, false));
}
}
private UltraGridRow CalcGridRowForDblClick(Infragistics.Win.UIElement uiElement)
{
this.m_firstRowOfTheHeaderThatWasDoubleClickedOn = null;
if (uiElement == null)
return null;
object elementContext = uiElement.GetContext(typeof(UltraGridRow));
if (elementContext == null)
return null;
UltraGridRow row = elementContext as UltraGridRow;
if (row != null)
this.m_firstRowOfTheHeaderThatWasDoubleClickedOn = row;
return row;
}
It works. The key was the UIElement.GetContext() function, which I finally found by reading a two sentence Knowledge Base article on the Infragistics website.
©2006 Marc Adler - All Rights Reserved
Thursday, April 06, 2006
RIP: Doug Walker (Alien Planetscapes)
Doug Walker, long-time mainstay of the New York Spacerock scene and founder of the band Alien Planetscapes, passed away Tuesday April 4th at home. Doug had a heart condition for several years, and it finally caught up to him.
Doug was one of my oldest friends. I met Doug in 1975, and played in several seminal free-jazz bands with him in the mid to late 70's, including the great Third Sun.
Doug lost his wife Fran 2 years ago in a horrific car crash.
Doug leaves behind his son Evan, who was born three weeks after my own son.
God Bless You, Doug. Now you can jam with Robert Moog.

©2006 Marc Adler - All Rights Reserved
Doug was one of my oldest friends. I met Doug in 1975, and played in several seminal free-jazz bands with him in the mid to late 70's, including the great Third Sun.
Doug lost his wife Fran 2 years ago in a horrific car crash.
Doug leaves behind his son Evan, who was born three weeks after my own son.
God Bless You, Doug. Now you can jam with Robert Moog.

©2006 Marc Adler - All Rights Reserved
Subscribe to:
Posts (Atom)