6
Microsoft .NET Customer Solution Case Study Trading Firm Increases Revenue Fourfold Through Parallel Development Environment Overview Country or Region: United States Industry: Financial services Customer Profile Tanius Technology, based in Danville, California, is a six-person algorithmic trading firm that trades its own money and derives revenue from the buying and selling of commodities, bonds, and other assets. Business Situation To achieve its revenue growth goals, Tanius Technology wanted to expand the number of assets and changes in the financial markets that its traders could track and act upon each day. Solution The company used the Microsoft Visual Studio 2010 Ultimate development system and the Task Parallel Library within Microsoft .NET Framework 4 to optimize its trading algorithms. Benefits Higher revenue Greater agility Faster development Improved code quality Increased scalability “By using tools such as the Task Parallel Library, we could fully parallelize our environment and, as a result, monitor 8 to 10 times more symbols and earn approximately 4 times as much revenue.” Karl Schulze, Member, Tanius Technology Tanius Technology, an algorithmic trading firm, sought to augment the number of financial events and stock exchanges that it monitored each day and boost its revenue by expanding its portfolio of financial assets. The company decided to use the Task Parallel Library and other parallel development tools associated with Microsoft .NET Framework 4, along with the Microsoft Visual Studio 2010 Ultimate development system, to parallelize its serial algorithms and increase computational capacity. The company gained the agility necessary to react to market changes quickly because its developers can write better code with fewer bugs at a faster pace. The improved compute capacity and developer productivity have made it possible for Tanius Technology to watch up to ten times as many symbols and earn four times as much revenue.

Metia CEP Trading Firm Increases Revenue Fourfold …download.microsoft.com/documents/customerevidence/Files/... · Web viewTanius Technology, an algorithmic trading firm, sought

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Metia CEP Trading Firm Increases Revenue Fourfold …download.microsoft.com/documents/customerevidence/Files/... · Web viewTanius Technology, an algorithmic trading firm, sought

Microsoft .NETCustomer Solution Case Study

Trading Firm Increases Revenue Fourfold Through Parallel Development Environment

OverviewCountry or Region: United StatesIndustry: Financial services

Customer ProfileTanius Technology, based in Danville, California, is a six-person algorithmic trading firm that trades its own money and derives revenue from the buying and selling of commodities, bonds, and other assets.

Business SituationTo achieve its revenue growth goals, Tanius Technology wanted to expand the number of assets and changes in the financial markets that its traders could track and act upon each day.

SolutionThe company used the Microsoft Visual Studio 2010 Ultimate development system and the Task Parallel Library within Microsoft .NET Framework 4 to optimize its trading algorithms.

Benefits Higher revenue Greater agility Faster development Improved code quality Increased scalability

“By using tools such as the Task Parallel Library, we could fully parallelize our environment and, as a result, monitor 8 to 10 times more symbols and earn approximately 4 times as much revenue.”

Karl Schulze, Member, Tanius Technology

Tanius Technology, an algorithmic trading firm, sought to augment the number of financial events and stock exchanges that it monitored each day and boost its revenue by expanding its portfolio of financial assets. The company decided to use the Task Parallel Library and other parallel development tools associated with Microsoft .NET Framework 4, along with the Microsoft Visual Studio 2010 Ultimate development system, to parallelize its serial algorithms and increase computational capacity. The company gained the agility necessary to react to market changes quickly because its developers can write better code with fewer bugs at a faster pace. The improved compute capacity and developer productivity have made it possible for Tanius Technology to watch up to ten times as many symbols and earn four times as much revenue.

Page 2: Metia CEP Trading Firm Increases Revenue Fourfold …download.microsoft.com/documents/customerevidence/Files/... · Web viewTanius Technology, an algorithmic trading firm, sought

SituationBased in Danville, California, Tanius Technology is a proprietary trading company that trades its own capital, mainly through the use of complex trading algorithms, which identify liquidity or find inaccurate pricings and place trades for the company. Tanius Technology primarily deals with futures contracts and commodities such as crude oil, gold, and silver. The company tracks these assets carefully, monitoring every event, which it defines as any change—positive or negative—in an asset’s price. “Our business model is unique to the financial services industry in that we generate revenue not through a product or traditional service but by the work we do,” says Karl Schulze, Member at Tanius Technology. “We deal with a different kind of pressure than that facing typical developers who work for customer-facing organizations. For one thing, we’re accountable not to customers or shareholders but to each other.”

There are hundreds of proprietary trading companies throughout the United States, most of which take advantage of technology tools to make their trading more efficient, but a lesser number use algorithmic trading. Tanius Technology developers not only devise algorithms, but they also create models of various derivatives that are able to recognize and provide liquidity that other banks and organizations do not.

Counter to the industry norm, Schulze and his partner have a math and computer science background and learned trading second. When they formed the company in January 2009, they started by automating every possible aspect of the business, hiring

employees to do only those tasks that the software could not manage. Although Tanius Technology has grown to a team of six, automation remains a guiding principal for the company.

Automation at WorkWhen it came to developing algorithms to automate its search for appropriate trades, Tanius Technology started with a system that performed primarily serial computations. That system was built using Microsoft .NET Framework 2.0 with basic thread management, handling events in the thread from which they were thrown. “Our main trading engine conducted a few asynchronous tasks, but in general it responded to events and initiated trades in a single-threaded manner,” recalls Schulze. “At that time, we had a smaller trading scope and did not watch as many stock instruments.”

As the company’s assets and trading grew in scale, however, Tanius Technology decided that it needed to make the switch to a parallelized, rather than serial, compute framework. The company moved to a publish/subscribe model that used the Microsoft Concurrency and Coordination Runtime (CCR) managed code library, which was packaged inside Microsoft Robotics Developer Studio 2008. “We chose to rely on Microsoft technologies from the very beginning because they were familiar to us and provided development efficiencies that we could not find elsewhere,” says Schulze.

The Need to ExpandAlthough using CCR worked well for the company, Tanius Technology found that it needed additional tools to further advance

26

Page 3: Metia CEP Trading Firm Increases Revenue Fourfold …download.microsoft.com/documents/customerevidence/Files/... · Web viewTanius Technology, an algorithmic trading firm, sought

its code-parallelization efforts. “It is the sheer number of events that we monitor and must respond to each day, as opposed to the actual math, that makes our job such a challenge,” explains Schulze. “We didn’t want to purchase and maintain a whole lot of hardware as we added assets and began to monitor more stock instruments.”

The company’s decision to store all the price-change events that occurred in each of its various futures contracts and commodities presented another scalability challenge. Its developers wanted to be able to replay those events at any point so that they could perform back-testing and strategy optimization for the trading algorithms using actual historical data.

SolutionEarly in 2010, Tanius Technology determined that it needed to expand its business to include monitoring and working with other instruments because the more symbols it monitored, the more revenue it could generate.

At around that time, their use of CCR was replaced by components built on top of the

Task Parallel Library (TPL), a set of public types and APIs in the System.Threading and System.Threading.Tasks namespaces in Microsoft .NET Framework 4. Tanius Technology now uses .NET 4, including TPL, and the Microsoft Visual Studio 2010 Ultimate development system to meet its computational requirements, which include processing more than 25 million events and 65,000 trades each day.

The company’s previous parallelized system had a dispatcher, task framework, and data pipeline that developers used to route messages through ports to make their algorithms run, but these were not tied to the Microsoft .NET Framework the way that the components of TPL are integrated with .NET 4. Tanius Technology now relies on the dataflow library and ActionBlock within the Visual Studio Async CTP, an extension of Visual Studio 2010 that provides a streamlined syntax for asynchronous development, to dictate which tasks are performed asynchronously and which are done synchronously. “We appreciate the ability to specify sets of tasks that have to run exclusively and concurrently so that we can control the flow of events,” says Schulze.

In using tools for parallel development from Microsoft, Tanius Technology has switched from writing synchronous code to writing mainly asynchronous code that generates events and tasks to be done as quickly as they can, wherever they can. Developers break down dependencies to the smallest message required to do a portion of work, as opposed to writing code that is dependent on a lot of state variables.

36

Figure 1 – This sample source code demonstrates that, using TPL, a single class can handle many different types of asynchronous messages in an exclusive manner.

Page 4: Metia CEP Trading Firm Increases Revenue Fourfold …download.microsoft.com/documents/customerevidence/Files/... · Web viewTanius Technology, an algorithmic trading firm, sought

Tanius Technology also uses cloud-based compute clusters to optimize its trading algorithms. The company runs simulations using its stored recorded data with a genetic optimizer to tune its models. Tanius Technology can have 100 CPUs, each one running an instance of its simulations, all testing different parameter sets to see how they perform and which work best. “We’re using dynamic virtual instances of the Windows Server 2003 operating system in the cloud, all with the same image, so that we can turn on and off capacity using the same API.”

BenefitsTanius Technology uses Microsoft parallel development tools to speed development, improve code quality, and stay flexible to meet changing market needs, which helps the company be more competitive. “Until recently, the adoption of parallel code has been in its infancy, even though developers have had the ability to write it for years,” says Schulze. “Developers now can take advantage of the great steps that Microsoft has taken in making highly parallelized code possible using its robust and easy-to-use tools. That is particularly important for small shops like ours, where it would likely not be feasible to write very complicated parallel code without such tools.”

Higher RevenueTanius Technology has been able to increase revenue because parallelized code has made it possible to expand the number of symbols that it monitors on a daily basis. “By using tools such as TPL, we could fully parallelize our environment, and, as a result, monitor 8 to 10 times more symbols and earn approximately 4 times as much

revenue for the company, without the need for additional hardware,” says Schulze.

Greater AgilityThe company credits its ability to react immediately to shifting financial markets to its adoption of parallel development tools. “Our end-to-end processing latencies have dropped, and because we were able to parallelize any message coming in, we now can react about eight times faster to any one event,” says Schulze. “Responding with alacrity to a change in market conditions relates directly to enhanced profitability.”

Tanius Technology not only parallelized its existing code efficiently, but it also continues to make quick adjustments to the code for further optimization. “Without the Microsoft parallel development tools, we could never have accomplished all that we did with just one developer in a couple of days,” says Schulze. “We’d have had to develop the building blocks we need ourselves, rather than taking advantage of those in TPL, and that would have taken months. To have waited for months rather than days to get what was necessary to meet our business needs meant increased costs for our company.”

Faster DevelopmentTanius Technology determined from the start that it could maximize developer time using technologies from Microsoft. “To handle our load requires careful parallelization, and multi-threaded code is challenging to write well and debug, in part because anything asynchronous can be unpredictable, resulting in intermittent bugs,” says Schulze. “We have found that using TPL and .NET 4, with its integrated pieces, is wildly more efficient for us than

46

Page 5: Metia CEP Trading Firm Increases Revenue Fourfold …download.microsoft.com/documents/customerevidence/Files/... · Web viewTanius Technology, an algorithmic trading firm, sought

to write in native C or another non-managed language.”

The company noticed a marked acceleration in its development speed with the adoption of TPL and the Async CTP. “Trading algorithms can have as many as 100,000 lines of code, which can take more than an hour to compile, but we can compile code and catch bugs in about 40 seconds by using .NET 4,” says Schulze. “Practically speaking, it runs nearly as fast as native code, especially after the first execution.”

Previously, it could take two weeks for Tanius Technology developers to go from a code design brainstorming session to actually writing code, but now they accomplish all that and have code ready to use in production in just four hours. “Because it is difficult to guard the trade secrets related to automated trading, we prefer to do as much as possible with as few trustworthy employees as possible,” says Schulze. “We can stay competitive despite our small size by using Microsoft parallel development tools, which make everyone highly productive.”

“For us, time truly is money,” continues Schulze. “Our development agility as a result of using the Task Parallel Library and .NET 4 is making it possible for us to code a lot more, faster. In the trading business, that’s everything.”

Improved Code Quality In addition to generating code more quickly, Tanius Technology is producing code of a higher quality. The company’s shift to using parallelization tools has made it easier for its developers to test and refine

its algorithms because they have the means to quickly break out the code into small pieces with clean input and output. “Because of the way that TPL and the overall framework work, our developers are coding within a better structure, so the quality of our code has definitely improved as a result of using these tools,” notes Schulze. “We now catch production bugs earlier and find fewer overall.”

Increased ScalabilityDuring the first half of 2010, Tanius Technology encountered hardware limitations with its system, but developers quickly rewrote their algorithms using TPL. Since that time, the company has yet to encounter any software or hardware limitations with its new parallelized compute environment, which means that it has the ready scalability that it needs to be able to continue its planned growth, monitoring and trading more assets as time goes on. “It can be a challenge to break up algorithms into tasks,” explains Schulze. “By parallelizing with TPL and .NET 4, we’re able to monitor more with the same hardware. With our processing capacity now virtually unlimited, we can concentrate our efforts on finding even better strategies and new asset classes to trade, rather than on adding and managing more hardware.”

56

“We can stay competitive despite our small size by using Microsoft parallel development tools to make everyone highly productive.”Karl Schulze, Member, Tanius Technology

“Our development agility as a result of using the Task Parallel Library and .NET 4 is making it possible for us to code a lot more, faster. In the trading business, that’s everything.”Karl Schulze, Member, Tanius Technology

Page 6: Metia CEP Trading Firm Increases Revenue Fourfold …download.microsoft.com/documents/customerevidence/Files/... · Web viewTanius Technology, an algorithmic trading firm, sought

Microsoft .NETMicrosoft .NET is software that connects people, information, systems, and devices through the use of web services. Web services are a combination of protocols that enable computers to work together by exchanging messages. Web services are based on the standard protocols of XML, SOAP, and WSDL, which allow them to interoperate across platforms and pro-gramming languages.

.NET is integrated across Microsoft products and services, providing the ability to quickly build, deploy, manage, and use connected, secure solutions with web services. These solutions provide agile business integration and the promise of information anytime, anywhere, on any device.

For more information about Microsoft .NET and web services, please visit these websites: www.microsoft.com/netmsdn.microsoft.com/webservices

66

For More InformationFor more information about Microsoft products and services, call the Microsoft Sales Information Center at (800) 426-9400. In Canada, call the Microsoft Canada Information Centre at (877) 568-2495. Customers in the United States and Canada who are deaf or hard-of-hearing can reach Microsoft text telephone (TTY/TDD) services at (800) 892-5234. Outside the 50 United States and Canada, please contact your local Microsoft subsidiary. To access information using the World Wide Web, go to:www.microsoft.com

For more information about Tanius Technology products and services, visit the website at: www.taniustech.com

This case study is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.

Document published May 2011

Software and Services Microsoft Visual Studio− Microsoft Visual Studio 2010

Ultimate Microsoft Server Product Portfolio− Windows Server 2003

Technologies− Microsoft .NET Framework 4