back

NASDAQ uses Flex and Adobe AIR to deliver market replay application

by Julie Campagna

NASDAQ Market Replay is a desktop application that gives investors and brokers instant access to extremely detailed trading activity at any point in the day. For example, users can query when a stock trade happened and play forward and backward the market events as if they were watching the market in real time.

"I wanted to develop NASDAQ Market Replay because of my own experience as an individual investor," says Claude Courbois, associate vice president of NASDAQ OMX Global Data Products. "I would buy some shares and then discover that I paid a price that differed from where I could see the stock trading. I would be scratching my head wondering what the heck happened."

"Working for NASDAQ gave me the opportunity to build a product that can help investors better understand what happens in the market. The trouble was that every time I pitched the idea of building a market replay product, I was told how expensive it would be to build," says Courbois.

For starters, NASDAQ would have to expand database and server capacity to quickly respond to thousands of data requests from enormous databases. "The expense of keeping all that market data online was too high. We'd have to charge our customers too much to use the product," says Courbois.

However, during the summer of 2007, Courbois hired an intern and assigned him the impossible task of researching and building a market replay application. The intern downloaded the Adobe Flex and AIR betas and began prototyping.

Three months later, Courbois had a working prototype to show NASDAQ executives. The response from the executives was very positive, and he soon had an in-house team of six web developers working full-time on the project.

AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of Adobe® Flash® Player.

Download the free Flash Player now!

Get Adobe Flash Player

Under the hood

NASDAQ developers built and deployed the Market Replay application using Adobe Flex, Adobe AIR, and Amazon Simple Storage Services (S3):

Charting the market with Flex

NASDAQ uses Flex as an open-source framework for building and maintaining its internal trading systems and customer-facing web applications. With the release of Adobe AIR, NASDAQ now uses Flex to build desktop applications as well.

Flex offers a library of components that facilitate UI design and application development. These prebuilt components are the building blocks of the Flex framework. By simply dragging and dropping Flex charting components into the application and linking them to Amazon S3 (using the Flex charting library), NASDAQ quickly prototyped, built, and deployed Market Replay.

"Flex has been extremely helpful as a framework for us to speed up the development process. With the charting components and grid components, we can render data on the screen very quickly so that any textual changes or data updates are immediately reflected — and we're talking about 200 millisecond updates where the application has to keep up with all the data," notes Alex Zinder, programmer, NASDAQ OMX.

"People are always surprised when I tell them we built Market Replay using Flex components because it just doesn't look like a standard Flex application," says Courbois. Because Flex is open source, developers were able extend and customize the appearance of the components to be more in line with NASDAQ data products. For instance, the gridlines are implemented via a custom backgroundElements renderer. And the selection box and playhead UI are implemented as annotationElements on top of the main chart display.

Data management

The data is stored on Amazon S3 as flat files. One file covers one stock symbol on any North American exchange for a 10-minute time period during the day. (NASDAQ adds more than 300,000 files per day to the several million files that already exist "up in the cloud.")

Running on the desktop, Adobe AIR pulls in the flat files and generates the replay animations using data from the files. The user can then replay the market regardless of whether they're online or offline.

According to Courbois, Amazon S3 provides an inexpensive and scalable solution for storing an unlimited amount of historical market data while Adobe AIR provides an ideal runtime for the client application because it uses the processing power of the client's computer to make calculations quickly on large data sets.

According to Courbois, "There's no doubt that working in Adobe AIR is a huge benefit with these large data sets. The ability to process trading data on the desktop enables NASDAQ to deliver valuable data analysis at a lower cost to everyone involved."

Where to go from here

 

Participate in a survey about developer tools and services… and be entered to win a 32 GB Apple® iPod Touch.

 

‹ Back


Julie Campagna manages the Adobe Edge newsletter as part of her work on the Adobe Developer Relations team. In addition, she contributes feature articles and produces video interviews for the Developer Center. In her free time, Julie likes to dabble in Flash video and produce web-based movies that feature her two English bulldogs, Daisy and Laverne.