Archive

Archive for October, 2007

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

simulating an exchange

October 14th, 2007

oh dear
As we’ve seen, a trading strategy has two special relationships – one with an OMS and one with a market data source. Interesting things can be done when we swap out one or both of these collaborators. First let’s consider the OMS.

From the perspective of the strategy, the OMS is really a proxy for an exchange (or perhaps multiple exchanges) or more generally liquidity sources. The relationship is characterized by messages which are passed back and forth between the participants. A strategy might send an order to which an OMS might respond with an acknowledgment, a fill, a reject etc. If instead of partnering a strategy with an actual OMS we partner it with a piece of software that behaves like one but doesn’t actually touch our accounts, that is – an exchange simulator, then we can take our real-time trading activity and convert it to paper-trading activity. Suddenly, we are free to experiment with even foolish risks because no money is being placed in harm’s way.

Read more…

EMS Internals

Putting the pieces together

October 12th, 2007

it all fits?

I’ve zipped through a whole bunch of algorithmic trading stuff over the last several posts. Judging from the expressions on the faces of some very smart and experienced wall st professionals when I’ve covered the same material, it’s not obvious stuff. So, I’m going to back-track a bit by describing what each of the pieces are and how they fit together.

We’ll start with a trading strategy. What is it in an algorithmic trading context? Conceptually, it’s a simple enough thing. It’s something that can study market data and can manage positions. That’s really it. Its “eyes” monitor one or many sources of market data and its “hands” are poised over an Order Management System. There’s obvious potential for complexity with this simple definition and we’re even leaving out potentially important elements, but for now we’ll take this to be pretty much it.

Read more…

EMS Internals, FIX Protocol

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

redistribution

October 7th, 2007

redistribution The behaviour of the two strategies we described last time are easy to describe intuitively and they are furthermore in-line with what one might expect from mean-reverting and trend-following strategies.

A mean reverting strategy will tend to make many, reasonably frequent, constrained-size successful trades and then suffer a big loser.

A trend-following strategy will tend to suffer many, reasonably frequent, constrained-size losses and then celebrate a home run.

The two strategies we described last time have these characteristics and the only constraint we’ve put on them wrt to their big loser/winner event is that they’re both deployed with day-trading schedulers so that they start trading at a fixed time in the morning and flatten themselves at some fixed time later in the day. The same basic characteristics would emerge for other such fixed periods of time as well.

Read more…

performance analysis, strategy development

distribution

October 5th, 2007

misleading, eh?I’ll make a few more comments on the last strategy we looked at before we move on. Although I’ve panned it, it’s actually a nice strategy for consideration as it’s very simple to implement, efficient to run, has a plausible-ish sounding premise and can be permuted in many directions. It has the unfortunate characteristic of being a loser, but nothing is perfect. It might offset that characteristic by providing us with a means of seeing interesting phenomena or learning. For example, all of the futures exchanges I ran it against – ICE, CME and NYX performed very well. Might be something there. Or not. If we look at the distribution of the *best* performing of each of the 4 strategies we ran by instrument, we get a pretty clear picture:

gimme an R-...

Read more…

back-testing, books, performance analysis, strategy development

anatomy of a knockout

October 2nd, 2007

Contrary to what I’d written last time, I ran the test across some
1,190 equities yielding some 4,760 resultant strategies. Naturally,
when you look at a good number of cases like this, you’re going to
find some real doozies. Maybe there’s a good reason why some should
really yield above average returns with this strategy over some period of
time. I’ll leave that as the proverbial exercise for the reader…

If we look at some of the really good results like, say, this
humdinger for BID, we might think we’re onto something.

just look at dem curves

Read more…

back-testing, performance analysis, strategy development