Friday, November 28, 2008
Blue Threads For C++
(1) Agent Strategies for Automated Stock Market Trading
(2) Automated Trading Algorithms in C++.Net
(3) FRACNET: The Conditional Simulation of Cascade Models
and reviewing the content at cplusplus.com. I also viewed the seven part series of "Threading in .NET" on the Intel Software Network:
http://software.intel.com/en-us/videos/threading-in-net-best-practices-1-of-7-series
and led to the work by Intel on Threading Building Blocks at
http://www.threadingbuildingblocks.org/
I downloaded the 2.1 version to use with their tutorial and the Reinders (2007) book. In addition, at Developers.net the following case study on risk management and compliance
http://www.developers.net/intelisdshowcase/view/2534
discussed the 64 bit Intel Itanium 2 processors for Monte Calo credit risk modeling. This permits banks to base their credit risk profiles and capital investment strategies on more complex simulations.
Some more good articles:
(1) Primer: Developing Multithreaded Applications
http://www.developers.net/intelisnshowcase/view/544
(2) Developing Multithreaded Applications: A Platform Consistent Approach
http://cache-www.intel.com/cd/00/00/05/15/51534_developing_multithreaded_applications.pdf
(3) Multithreaded Game Programming and Hyper-Threading Technology
http://software.intel.com/en-us/articles/multithreaded-game-programming-and-hyper-threading-technology
Since most of the transformations for trading is done on matrices, we have
(4) Matrix Vector Mulitiplication and Multi-threading Benefits
http://software.intel.com/en-us/articles/matrix-vector-multiplication-and-multi-threading-benefits
(5) Three Methods for Speeding up Matrix-Vector Multiplication
http://www.developers.net/intelisnshowcase/view/152
Finally, we have
(6) Multi-Threading for Experts: Inside a Parallel Application
http://www.developers.net/intelisnshowcase/view/474
References
Reinders, James (2007, July). Intel Threading Building Blocks: Outfitting C++ for Multi-core Processor Parallelism (Paperback) Sebastopol: O'Reilly Media, ISBN 978-0-596-51480-8.
Monday, November 24, 2008
C++ Programming Channel
Creative Experimentation:Statistical Arbitrage
I was bringing my daughter back from Penn State University yesterday for Thanksgiving break and she had my Pi movie
http://www.pithemovie.com/gifpage.html
that I had not seen in some time and seemed to fit right in with the work this morning. I am reviewing the Statistical Arbitrage work of Ed Thorp published by Wimott Magazine. The first 3 parts are pdfs:
- http://www.wilmott.com/pdfs/080617_thorp.pdf
- http://www.wilmott.com/pdfs/080630_thorp.pdf
- http://www.wilmott.com/pdfs/080709_thorp.pdf
Parts 4-6 are Word documents and can be found in the references at
http://en.wikipedia.org/wiki/Statistical_arbitrage
The articles examines the 70s-80s-90s work in this discipline. Here some of his thoughts and I would encourage to read all six parts of the article.
The Middle Game
Part 1:
Stocks with a large trading volume are called "liquid". They calculate a "fair" price for the largest and most traded stocks on both the New York and American Exchanges. Their strategy is based on their prediction buy the underpriced stocks and short the overpriced stocks. Each stock is 2.5 percent of the long portfolio. They limit the short position to 1.5 percent for each stock. Because of their strategy their results are "postively skewed".
There are about 253 trading days per year.
Part 2:
The author reviews the meaning of arbitrage with hypothetical numerical examples.
First example:
"An example might be sellinggold in London at $300 an ounce while at thesame time buying it at, say $290 in New York.Suppose the total cost to finance the deal and toinsure and deliver the New York gold to Londonis $5, leaving a $5 sure profit. That’s an arbitrage in its original usage." -Ed Thorp
They depend on a large number favorable trades to eventually deliver a profit. The basic
question is "How inefficient is the market?" "How can this be exploited to our advantage?" I agree that questions are more important than answers.
The article provides an overview to the historical answer to these questions.
Part 3:
A discussion on the refrigeration of CPUs and risk reduction. In order to control risk, they segregated into industry groups using factor analysis became the STAR model with 55 industry and 13 macroeconomic factors.
Part 4:
The article makes the important point.
"Note that every stock market system is necessarily limited in the amount of money it can use to produce excess returns. One reason is that buying underpriced securities tends to raise the price, reducing or eliminating the mispricing, and selling short overpriced securities tends to reduce the price, once again reducing or eliminating the mispricing. Thus systems for beating the market are limited in size by the impact of their own trading." -Ed Thorp
Part 5:
A discussion on haggling. I like this quote with the reference to 1/8 dollar a share by
"As President Lyndon Johnson once said about congressional spending, a billion dollars
here, a billion dollars there, and pretty soon you’re talking about some real money." -Ed Thorp
Another right on target quote that dovetails with my reading of Kasparov's latest book
"How Life Imitates Chess" is
"It reminded me of my granddaughter Ava, who when asked at the age of two, “What’s happening?”, replied “Nothing’s happening.” My beautiful ideas were rotting on the vine for lack of follow through. It was clear that if I wanted significant research and development we would have to do it 'in house.'" Back to the Pi movie and looking at every detail of the problem asking questions and leaving bread crumbs.
Part 6:
It is all about time..TIME...TIME... The discussion is on the hedge fund business-a statistical arbitrage hedge fund.
The End Game
The days are passing and ideas are percolating. I think back to Kasparov's book and the following quote:
Play the opening like a book,
the middle game like a magician,
and the end game like a machine.-Rudolf Spielmann
and his comments that, the purpose of the opening isn't to just survive the beginning of the game, it is to set the stage for the type of middle game you want to play.
Thursday, November 20, 2008
Algorithmic Engines for Trading Strategies
As I continue my research this week, the following resources provide insight into the different types of algorithms available.
- http://www.itg.com/
- http://www.itg.com/news_events/papers/AlgoTradingCostsTheTrade2007.pdf
- http://advancedtrading.thewallstreetwiki.com/directories/directory-algorithmic-trading.php
Some Basic Strategies:
- Dark
- Active
- Volume
- Participation
- Volume-weighted average price (VWAP)
- Time-weighted average price (TWAP)
- Arrival Price or Implementation Shortfall (IS)
- Pair
- Short Sell
- Contingent
- http://www.nri.co.jp/english/opinion/papers/2007/pdf/np2007121.pdf
- http://www.capis.com/resources/pdf/Algorithms.pdf
- http://www.cs.tau.ac.il/~mansour/papers/06stoc.pdf
- http://web.unx.com/index.php?option=com_content&task=view&id=44&Itemid=26
- http://www.itg.com/news_events/papers/AlgoSelection20060425.pdf
II. VWAP (volume-weighted average price)
Anatomy of An Automated VWAP Strategy:
http://www.itg.com/news_events/papers/TP_Spring_2002_Madhavan.pdf
Code:
http://www.codeproject.com/KB/recipes/VWAP.aspx
Limit Order Trading:
http://www.cis.upenn.edu/~mkearns/papers/vwap.pdf
III. Conclusion
http://www.advancedtrading.com/showArticle.jhtml?articleID=196900760
Next step is to research current trading architectures.
Tuesday, November 18, 2008
White Label Algorithmic Trading Platforms
http://www.modulusfe.com/tasdk/vcpp.asp
Furthermore, they have a video demonstration of their application with discussion at
http://www.modulusfe.com/m4/
It is worth the investment of time to go through their site and think about a multi-tier object-oriented approach, modules and design patterns to this kind of system as well as an open source purchase of the building blocks for the application. More on this in the next post.
More research on this topic uncovered the following:
Sockets
- http://www.topjimmy.net/tjs/Pages/Development/TJFTP/
- http://www.codeproject.com/KB/cs/ChatApplDotNetSockets.aspx
- http://www.devx.com/dotnet/Article/28083
Multithreading
- http://www.devarticles.com/c/a/Cplusplus/Multithreading-in-C/
- http://www.c-sharpcorner.com/Articles/ArticleListing.aspx?SectionID=1&SubSectionID=149
Generalities
Monday, November 17, 2008
Automated E-Trading Systems in .NET
In addition, this research is on the use of Smart Order Routing/Matching Engine and the architecture of Order Management Systems and review fixed income derivatives and exotics. Thus, the posts this week will use this as a basic motif.
Monday
Smart Order Routing/Matching Engine
- http://www.thetradenews.com/791
- http://streambase.typepad.com/streambase_stream_process/2008/09/smart-order-routing-and-cep.html
- http://complexevents.com/wp-content/uploads/2008/09/streambase_whitepaper_smart_order_routing.pdf
- http://www.futuresindustry.org/downloads/Jul-Aug-Algo.pdf
- http://www.pipelinetrading.com/resources/wst7371_final.pdf
- http://www.tradingtechnologies.com/news/TT_FA05.pdf
FIX
Tuesday
Visual C++ and Trading Systems