Archive

Archive for the ‘back-testing’ Category

goldman hacks

March 12th, 2009
rebranding?

rebranding opportunity?

A friend of mine pointed out an article he came across on his bloomberg terminal today which reminded him of a strategy I’d described to him sometime back and which we’ve been trading over the past year or so with good results.

To the great chagrin of some of my partners, I even wrote a few posts about the phenomenon underlying our strategy and its evolution as we capitalized on it.  Eventually, they persuaded me to shut up already, but the outline was there for all - including Goldman! - to see.

My first post on the topic, “unsung virtues of a dynamic hedge” published June 4th of last year, was pretty coy and didn’t mention the source of alpha itself but talked about enhancing it with a dynamic hedge.

My next post on the topic, “to dream” was published July 14th of last year and laid out the exploitable discrepancy of the market’s behavior.  Interestingly, the data I provided in that posting went back the same amount of time as in Goldman’s piece.

I explicitly wrote one last time about the strategy in “evolution of a strategy” wherein I detailed the process by which we’d been evolving the strategy.

Now, one of the more entertaining things about having a blog is that you get to see who is viewing your content.  I’m happy to note that all of the major IBs are represented including a variety of distinct IPs within Goldman.

Now, I’m not accusing them of stealing my ideas or anything untoward like that… but I’ll admit that I am wondering how long it’s going to take them to make similar observations across markets beyond US Equities…

Read on for the Bloomberg article…

Read more…

back-testing, dereferenced, strategy development

trading the news

November 18th, 2008

Inevitably one of the first ideas people have when they start thinking about how to write a trading algorithm turns out to be among the hardest: trading the news.  The problems are many and in some cases not so obvious…but the natural appeal of the idea seems universally compelling.

Just after the dot.com craze, a brilliant friend of mine (who had just sold his web consulting startup) decided to write a book.  The premise was glorious.  A bunch of clever college-age kids formed a startup to predict the stock market.  The method they used was to constantly comb the web with ultra-sophisticated algorithms which would run across giant server farms overnight and ultimately generate tomorrow’s headlines.  Based on the headlines that their system generated, they would place trades that would take advantage of these predicted events.

Sadly, my friend never went on to complete his book, so I don’t know how it all turned out.  (Instead, he went on to start another successful company, this time in the field of robotics.)  While he was writing it, I loved getting new drafts as they were filled with clever ideas.  But the core idea of predicting headlines and then using those headlines to trade always struck me as especially cute.

For those of us without access to news-predicting algos, writing strategies based on the news is rather less straight forward, though there are a growing variety of products and services aiming to fill the gaps.  Today must have been trading-the-news-day as I found a few articles on the topic in my mailbox and even received a cold call from a vendor, Need to Know News, with just such an offering.  Below I’ll look at some of these offerings and consider some of the issues involved in writing trading strategies based on the news. Read more…

back-testing, market data, startup, strategy development, technology

billions and billions

August 22nd, 2008

billions and billions

While Carl Sagan’s famous formulation introduced a generation to the vastness of the cosmos, more recent history suggests that his memorable term might now be more aptly applied to financial extents: our deficits and debts, perhaps, to the economically or politically minded. But for those of us with the markets on our mind, the term has to evoke the enormity of the data we create and must manage every day. We’ve recently been working with the NYSE’s TAQ data in an effort to integrate it into StratBox’s back-testing and optimization capabilities. And the enormity of the data is really just staggering.

Each day, the NYSE publishes all of the day’s quotes and trades as well as some reference data. Compressed, the data will just about fit onto a DVD. For one day. A DVD. Compressed. It’s really mind-boggling. A year of the stuff, uncompressed, will require over a petabyte of storage. Over 1,125,899,906,842,624 bytes. And that’s just the US Equities markets. You want options data, too? I hope your uncle is named EMC, because just managing the data is going to be a challenge

Read more…

back-testing, market data, open-source software, post-trade analysis, technology

execution quality at the open & close

August 1st, 2008

Execution Quality

I’ve been trading an increasing amount at the open and close of the equity markets using market-on-open (MOO) and market-on-close (MOC) order types and have found that the quality of executions varies enormously between the two types and have spent a bit of time analyzing the differences which I share below.

The quick scoop is that MOC orders almost invariably fill at the exchange’s published closing price, while MOOs vary very substantially from the published open price. Below I quantify my findings in a bit greater depth.

Read more…

back-testing, execution quality, performance analysis, post-trade analysis, strategy development

to dream

July 14th, 2008

... People have long imagined ways to make money while they slept. Happily, it’s not a pursuit I’m particularly bothered by, but as I develop trading strategies, I do make note of different market behaviors that correlate to the time of day. Or night.

In particular, I’ve been looking at various market-breadth ETFs recently as possible fodder for the little dynamic hedger I’ve described before, and I’ve noticed an interesting behavior among several of them…

Like the majority of traders, they do better when they’re not trading!

That is, they actually display better performance at night than they do during the regular trading day; there’s more profit to be had in their gaps between sessions than there is during trading sessions. Below I quantify this observation more thoroughly…

Read more…

back-testing, strategy development

perils of parameterization

July 8th, 2008

What he might do with 6 parameters?...

I came across and had to share this excellent vignette by Freeman Dyson on the perils of excess model parameterization…

In desperation I asked Fermi whether he was not impressed by the agreement between our calculated numbers and his measured numbers. He replied, “How many arbitrary parameters did you use for your calculations?” I thought for a moment about our cut-off procedures and said, “Four.” He said, “I remember my friend Johnny von Neumann used to say, with four parameters I can fit an elephant, and with five I can make him wiggle his trunk.”

back-testing, strategy development

quantifying friction

May 6th, 2008

Pay TollI recently had a pretty visceral encounter with the forces of friction. No, I didn’t fall off my bike - I’m talking about the friction inherent in trading activities. I’ve mentioned Andrew Lo’s market-neutral long-short algorithm before and it sees service as my blogging muse once again. I’ve modified his original algorithm such that it behaves reasonably well though, as he observes, it’s a strategy in long term decline. My recollection was that one might expect 15-20% from an unlevered deployment of the strategy.

Recently, I went to play with it and to my shock and horror it had become a wretched loser. In fact, an incredible loser. What had happened? I looked throughout my code and couldn’t find changes; this was corroborated by my CVS repository - no changes had been made to the strategy in a long while. Any coder is familiar with the natural entropy of software systems known pejoratively as “code rot” but this seemed an especially extreme case.

Read more…

back-testing, hedge funds, performance analysis, strategy development

the character of a winner

April 4th, 2008

Rocky Marciano, history's only undefeated heavyweight championHe didn’t look like much, but old Rocky Marciano put his back into every awkward punch he threw. More remarkably, he remains the only heavyweight champion to have ever been smart enough to get out of the game on top. He was that rarest of characters - a winner who knew when to engage and when to step away.

I’ve written a good deal about losers and ideas that might not yield the results one’s looking (hoping) for, but I haven’t written too much about life’s winners. This, of course, is absolutely par for the course amongst traders. People aren’t in the habit of giving away trade secrets, leaving sums of money on the sidewalk or revealing their trading strategies. When they do (or claim to) is likely a good time to keep an especially watchful eye on your possessions…

Read more…

back-testing, performance analysis, portfolio management, strategy development

multiverse

October 18th, 2007

turtles all the way down

There are many conceptions of our world and its underlying nature, each seemingly more creative than the last. One of my favorites - adopted by all serious fans of Star Trek as well as some physicists who’ve run rather far afoul of friar Occam’s good rule - posits the existence of a multiverse. There are various such stories, but the basic idea is that at every quanta in time the universe partitions itself off into an infinitude of parallel instances of itself, each representing a different branch of realized possibilities. In this one, I decided to become a surfer while in that one I went into finance and in that one I led the US to its first-ever world cup victory. While we only experience the particular universe we happen to be situated in, the multiverse represents the simultaneous execution of all possible universes. Under this view, we really do live in the best of all possible worlds.

This idea has surprising utility. While its cosmological implications might represent the extreme psychedelic fringe of the continuum, at the other ends lies actuarial science, the foundations of risk management and, yes, a variety of option pricing techniques.

Read more…

EMS Internals, back-testing, options pricing

A trading strategy is an option

October 10th, 2007

options, options, ...

The best way to reason about a trading strategy’s performance, that is valuing it, is as an option.

Or perhaps as a collection or portfolio of them.

I have to assume that people reading this have a working idea of what an option is, so I’m not going to provide definitions that can be readily found elsewhere. I will note that my favorite book on the trading of options is by Allen Jan Baird.

Let’s consider the three illustrative trading strategies we’ve looked at up until now. The trend-following strategy suffered many little losses and then enjoyed a big win. Sounds like buying options. The mean-reverting strategy made lots of little profits and then risked getting clobbered with a big loss. Sounds like someone who’s writing options. And the first strategy we looked at, the morning range breakout, had a payoff which looked like a long straddle or strangle where the break-evens were near the observed high and lows for the session (where we set our entry stops).

straddle payoff

Now, there’s obvious differences between the trading strategies’ payoff structures as compared to the similar options strategies. There’s no premium, for instance, and that’s clearly significant. The morning range breakout seems to exhibit a sort of knockout effect when a position has been entered but then the market reverses and you’re “knocked-out” of your position. You just take a loss and do not collect even if the market turns back in your direction. With a straddle you don’t have this behavior. There are differences and they are worth keeping in mind. But the reasons for viewing trading strategies as options portfolios are many and compelling.

The superficial reason, as I mentioned, is that the basic payout structures are potentially similar. The deep reason is that ultimately the problems are the same - how to value complex instruments with engineered payouts. And the pragmatic reason is that many many very smart people have applied their considerable brains and diverse skill-sets to advancing options pricing techniques. There’s also a great deal of high quality software available out there which can be used to adapt these time-proven techniques to your own algorithmic trading strategy valuations.

The techniques which we’ve seen up until now, back-testing and parameter optimization, are sort of weak cousins of a family of techniques long used for options pricing: Monte-Carlo (MC) methods. MC simulation can clearly be used to assess a trading strategy’s performance.

In subsequent posts, we’ll talk about some of the details of each of these techniques and about some of their respective trade-offs. That should keep my pump primed for a bit, but in the meanwhile I leave you with a parting inquiry: what other options pricing techniques might we apply to our algorithmic trading practices?

back-testing, books, monte-carlo methods, open-source software, options pricing, performance analysis, strategy development, technology