Monthly Archives: September 2011

Ray Dalio: A Template For Understanding What’s Going On

Ray Dalio, founder of Bridgewater Associates, is one of the leading investment managers of our generation. Curated Alpha has touched upon him several times in this blog’s short existence (here, here, and here). Given recent market volatility, it may be helpful for readers to review Ray Dalio’s A Template For Understanding What’s Going On, most recently revised on June 30, 2010.

A Template For Understanding What’s Going On provides an excellent overview of the major fundamental concepts of monetary economics. What causes recessions, depressions, and financial crises? How should central banks react? It is worth noting that I believe that our understanding of optimal monetary policy is still evolving and improving through time.

Students of monetary economics should be very familiar with the overall paper, but Dalio contributes to the literature in three significant areas:

(1) Dalio provides a holistic view of the financial crisis, providing the reader with a strong understanding of how everything is connected together. This is often lost in academic finance, which often has a theoretical focus where models or concepts are presented in isolation. Dalio’s colleague Bob Price describes him as “a big-picture thinker connected to a street-smart trader” and this characterization really shows. Dalio’s review takes an applied macroeconomics approach rather than focusing on macroeconomic theory. Taking a holistic view of financial markets is critical for successful trading — not only can it help you identify investing opportunities with greater accuracy, it exposes you to multiple markets. Therefore, you are able to choose which market and which security is best suited to carry out your trading thesis.

(2) Dalio stresses the difference between recessions and deleveragings. Standard economic theory usually identify recessions and depressions by changes in GDP. Dalio, however, presents a classification based on the availability of credit and the ability of the central bank to stimulate the economy using monetary policy.

(3) Dalio presents the idea of “long wave” debt cycles. Dalio himself states that “whenever we start talking about cycles, particularly the long-wave variety, we raise eyebrows and elicit reactions similar to those we’d expect if we were talking about astrology”, but readers should pay close attention to this section as I feel it is a unique and independent idea.

Readers may view the paper here.

Follow Curated Alpha via Email, RSS, or Twitter.

 

Is Trading A Game?

How much is trading like a game? And will other professions become more game-like in the future?

The trick seems to be that games are constrained in a way that the real world isn’t: there is a board, field, pitch, court, area, table, ring or other enclosure that bounds the action in space; clocks that bound it in time; and rules that restrict the space of allowable moves.

In some ways those constraints are what make games mentally satisfying, because they relieve us of what existentialists called “the anxiety of freedom.” By giving us obvious, well-defined goals, they save us from having to define success; and with points, leaderboards, heads-up displays, indicators, badges, etc., they tell us exactly when we’ve achieved it.

Humans crave that kind of structure, probably because we get so little of it in real life. It’s a lot harder to say whether you “have a healthy romantic relationship” or “are making a lasting contribution to something bigger than yourself” than that you’ve “lined up the yellow gemstones,” “scored more points than the other team in twenty minutes,” or “collected forty pounds of silver.”

Now think of what a trader does. A trader’s job is to be smarter than the market. He converts a mess of analysis and intuition into simple bets. He makes moves. If his predictions are better than everyone else’s, he wins money; if not, he loses it. At every moment he has a crystalline picture of his bottom line, the “P and L” (profit and loss) that determines how much of a bonus he’ll get and, more importantly, where he stands among his peers. As my friend put it, traders are “very, very, very competitive.” At the end of the day they ask each other “how did you do today?” Trading is one of the few jobs with an actual leaderboard, which, if you’ve ever been on one, or strived to get there, you’ll recognize as being perhaps the single most powerful driver of a gamer’s engagement.

Continue reading.

Key Quotes From Paul Tudor Jones in TRADER: The Documentary

Paul Tudor Jones is famous for correctly predicting Black Monday when the Dow Jones Industrial Average dropped by 22 percent in one day. I recently re-watched TRADER: The Documentary, one of the classics in investor education. Wikipedia describes it as:

In the 1987, PBS film “TRADER: The Documentary”. The film shows Mr. Jones as a young man predicting the 1987 crash, using methods similar to market forecaster Robert Prechter.

Although the video was shown on public television in November 1987, very few copies exist. Those that do are hoarded by traders who watch the hourlong movie in the hope of gleaning possible trading tips from Jones. On the Internet, bids for the video start at $295. According to Michael Glyn, the video’s director, Jones requested in the 1990s that the documentary be removed from circulation. The video surfaced briefly on YouTube at the end of July 2009, before being taken down due to alleged copyright violation.

For the past two years, the video has been available here at Tudou, but recently has only been limited to viewers in Asia due to copyright violation. I watched a copy that I had saved to my local hard drive recently with the purpose of transcribing certain portions that I found particularly enlightening.

One theme throughout the documentary is that Paul Tudor Jones and other individuals profiled thoroughly enjoy the act of analyzing financial markets and they are not primarily driven by greed. This is a defining characteristic of investment managers who have reached the top of their profession:

Well I originally decided to come here to be on vacation, getting away from everything. Then as it turned out, a number of the clients are here in Europe, so I’ve been doing an enormous amount of business. I’ve been in Paris, I’ve been in Geneva, so I can combine business with pleasure. I wish it had been more pleasure, but I still wouldn’t trade it for anything in the world. If life ever ceased to be an educational experience, I probably wouldn’t get out of bed.

After a while, the size means nothing. It gets back to the question of whether you’re making a 100 percent rate-of-return on $10,000 or $100 million. It doesn’t make any difference. If you complete 78 percent of your passes, it’d be nice if you were in the NFL, but if you’re in college or high school or even elementary school, I’m sure the thrill is just as great.

Paul Tudor Jones’s intensity and passion is quite apparent throughout as well. The film crew follows him over a course of several months, so viewers are able to see him on a down 5 percent day and an up 5 percent day. Paul Tudor Jones shares some insights on the qualities he values most as an investment manager:

The whole concept of the investment manager making these incredible intellectual decisions about which way the market is going to go — I don’t want that guy managing my money. If he can be that dispassionate, he doesn’t have the competitive nature which is necessary to be a winner in this game. I want the guy who is not giving to panic, who is not going to be overly emotionally involved, but who is going to hurt when he loses. When he wins, he’s going to have quiet confidence. But when he loses, he’s gotta hurt.

To do the job right requires such an enormous amount of concentration. It’s physically and emotionally mandatory that you find some time to relax. And you’ve got to be able to turn it off like that. There will be times though that I get so incredibly excited about a trade or even a project that I’ll wake up at 4 o’clock in the morning and there’s no way in hell that I’m going back to sleep. I’ll sit there in my dreams and trade for four hours.

The one piece of advice directly applicable to individual investors is found in the middle of the documentary and it is quite simple:

Where you want to be is always in control, never wishing, always trading, and always first and foremost protecting your ass. That’s why most people lose money as individual investors or traders because they’re not focusing on losing money. They need to focus on the money that they have at risk and how much capital is at risk in any single investment they have. If everyone spent 90 percent of their time on that, not 90 percent of the time on pie-in-the-sky ideas on how much money they’re going to make. Then they will be incredibly successful investors.

And finally, Paul Tudor Jones’s comments on predicting Black Monday are eerily accurate and insightful:

The accumulation and then the repayment of debt basically drives every economic cycle that there is. Right now we have probably explored the envelope with regard to mortgaging our future earnings. The next part of this cycle will be the repayment of what we’ve enjoyed now for the past four or five years.

The last guy who buys a share of stock when the Dow is at 3,000 or whatever number it is, he’s buying it because he thinks it’s going to 6,000 because it’s been reinforced in his mind over the past however many number of months, years, or decades that stocks can’t go down.

The one thing that I’m certain about as a trader, and you’re talking to someone who is incredibly long the stock market, is that all of Wall Street and the investment community at large basically is geared towards a Dow somewhere in the 2,600 to 3,200 range. These are people who have track records that are impeccable. Let’s assume that they are 100 percent wrong. If nothing else, there will be a time unquestionably when the market turns down. The investment community almost at once will say “this was the top”, and you’re going to have all the people who are right now very comfortably investing, that are feeding off the hope that the market will go higher, try to get out at the same time. It’s just a question of how fast before we hit the bottom.

I highly recommend readers to watch this documentary. It has a very strong 80′s feel to it which is quite pleasant. Thorough searching through Google should yield a download link — if not, please contact me and I can try to help you obtain a copy.

Curated Interviews From Quants: Algorithmic Trading and High Frequency Trading (From Reddit’s IAmA) Part 3

What is it exactly that quants do?

This is the fourth post in a series of curated interviews from Reddit’s IAmA subreddit, a place where individuals of various professions and backgrounds can request the community to “ask me anything”. There has been a lot of new readers to the blog recently, so I strongly recommend new readers to first read my first post on investment bankers.

New readers should read part 1 and part 2 of this series also.

I have selected some curated questions and responses from that, in my opinion, comprise some of the best quant/algorithmic trading/high frequency trading interviews on Reddit.

I am a day trader who is up 35% over the past 12mos. AMA

  • What sort of algorithms does the bot use? What is its strategy?

The bot uses reversion to the mean strategies and is fully automated (its running as we speak) and completely non-discretionary. It requires no intervention – I could die right now and it wouldn’t even notice. It would keep trading and shut itself down at the close. I do extensive back testing using GA optimization and validate using Monte Carlo and walk forward techniques. The bot runs 100% off live data, but is optimized using historical data. I get my historical end of day and intraday data from IQFeed and real time data via my broker’s (Interactive Brokers) API.

My system is reversion to the mean, it doesn’t trade trends. I also don’t use moving averages or any other technical analysis indicators. Its all statistically based. I’d agree backtesting is worthless if you aren’t careful how you do it. Its certainly very easy to uncover fool’s gold. Note that I don’t use the off the shelf dogshit most retail traders attempt to optimize parameters with, plus I test everything 100% out of sample. EVERYONE who trades does some level of backtesting, even discretionary traders. Unless you’re wiping your brain clean each day, your trade decisions are all made based on the positive or negative outcomes of your prior trades. We’re all curve fitting, some of us are just more optimal than others about how we do it.

  • Any books you could suggest? Websites you frequent or did frequent to get your feet wet?

I’ve found the best trading books are those from the academic Computational Finance community. Stay away from the Wade Cook garbage at Barnes and Noble. Here’s some favorites:

In terms of websites, I hang around the Elite Trader forums quite a bit. They’re mean as hell there, so put on your thickest flame jacket before you post, but there’s some nuggets of useful info buried amongst the endless sophomoric dick slamming. Look at the posts by lescor and acrary. lescor (my personal hero) is a former fireman turned prop trader who pulls $50K+/month out of the markets and his equity curve is nearly a straight line.

  • Is there a specific broker that you can suggest with lower fees?

I’d suggest Interactive Brokers (they are who I use). They charge 0.005/share but you can get that down slightly with rebates if you add liquidity. There are other brokers out there, but IB is really the best option for retail traders. You can trade stocks, options, futures, and/or FX through IB. And they have the largest selection of markets to trade, including international markets like the DAX, KOSPI, FTSE, etc. Its hard to find a market they don’t offer, really.

Quant/high frequency trader “expert” AMA

  • How much does the latency of the data feed play into high frequency trading?

Latency is extremely important if the signals you trade are short term (up to hours). most exchanges have “colocation” facilities in which firms can rent space to run computers with their trading software. Every millisecond is important; firms spend millions of dollars to get an edge over the competitors. A lot of automated trading systems are not high frequency, so being the fastest isn’t that important. Most high frequency trading strategies are based on market microstructure (e.g. There are more shares on the best bid than the best offer, so the price is more likely to go up). It’s a strategic game that’s separated from supply and demand considerations. It is definitely the case that different dollar-amount stocks behave differently in microstructure and in short term movements.

  • What percentage of the total daily volume on SP500 index futures do you need to trade in order for HF trading to work ? Do you trade any illiquid equities, stocks with a small float ? What aspect of statistics do you use in your daily job ? Do you back-test your strategies on historical data ? If yes, how far back do you test ?
  • You can trade a very small amount (1 share per day) and still qualify as high frequency if the signals you are trading are based on high-frequency market data.
  • Yes, we trade illiquid stocks. Any strategy tailored for liquid names obviously has to be rethought for illiquid names, but it is possible and profitable to trade them.
  • I do a lot of regressions and similar testing to fit models, etc.
  • Yes, we backtest strategies. If it is a simple code change, we might just test a few months; for serious risk management strategy change, it could be a couple years.
  • What does high frequency mean? What would be an average or target duration for the length a trade stays open?

High frequency strategies are generally characterized by:

* High cancellation ratio – most limit orders are cancelled before they are filled.
* Low holding period – on the order of hours or less.

In general, high frequency traders don’t try to buy and immediately flip for a higher price (there are statarb strategies that do this). Instead, you usually have ‘signals’ that give you an indication of where things are going based on factors like market microstructure. Your signals indicate that, if you put out a buy limit order and you get filled, then you are in expectation making money. That doesn’t mean you should sell right away when you get filled; you again should generally sell only when you think you are making money by selling.

Is it as simple as “If X happens, does Y?” or is it much more complicated? Back when automated trading was a semi-serious hobby for me, people would say they trade “on book”, not on price. If that sounds familiar to you, could you give an example?

Examples (suppose A and B are correlated):

Trading on price: if stock A moves up and stock B moves down, predict they will converge in price (sell A and buy B).

Trading on book: if there are more bids than offers for stock A and more bids than offers for stock B, predict they are both going up (buy/post bids for both, or at least cancel offers at the front of the queue.)

Some strategies have very simple ideas and others are very mathematically complex.

IAmA partner at a mid-sized proprietary trading firm

  •  Could you also give some insight into the technology stack you use (programming languages, OS, open source tools, etc)?

 I’m going to assume that you, like most hobbyists, are trying to dump your data directly from the feed into the database. Your generic databases aren’t designed to be used like this. Take your feed data, process it however you need to, and then just append it to a binary log file, flushing every X amount of bytes. At the end of day, clean or process the data, and then insert it into your RDBMS.
If you need to query lots of data (billion and up), your RDBMS wont be optimal. You can try selectively loading sets of data you want to work with from your binary log files into the RDBMS, but this will limit your working set. You can try to use one of the NoSQL databases if your access patterns are a good match.
If you want something that will perform very well, simple emulate the way kdb+ or Vertica store data. Sort your binary log files by keys, index the file, and memory map for fast searching. On top of that you can splay the file, add block level compression, etc.

We work with several technologies.

  • Linux/Windows
  • C/C++ and Java with a sprinkling of some lesser known language like Clojure/J
  • Lots of open source and we do give back
  • Some proprietary third party software/hardware. A lot of our infrastructure was custom built earlier last decade and has been/is being phased out.
  • Could you talk a little more about general infrastructure and what parts are key to operating HFT strategies? How do you decide what programming language to choose or rather what is your development process?

I think individuals can compete if they know their shit, put in the time, focus on a niche, and have capital. In my opinion, most people are living in a pipe dream if they think they can go from novice to ATM operator printing money. That is not how it works. There are things larger firms will not operate in because it simply isn’t worth it. You have to consider that there are fixed costs and we need X amount of profit to make deploying something worthwhile. These niche markets are probably less common than one may think. Carve out a strategy where you have a competitive advantage, don’t try to beat me at my own game.
You need low latency infrastructure and fast execution, what specifically do you want to know? If we need to develop and implement something, we define constraints and requirements and pick a language from there. It’s very much a best tool for the job process and generally high performance components are written in C++, enterprise components in Java, prototyping/fast tooling is done in some scripting language, and text processing in awk.