blog.sojoodi.com

November 23, 2007

Exchange Rate Arbiterage Detection

Filed under: Uncategorized — Sahand @ 7:21 pm

Here’s a little brainteaser to think about while commuting to work on the Greyhound bus! (that’s another story maybe for another post).

If you go to x-rates.com or Yahoo Currency Converter you can obtain a table of exchange rates for world’s major currencies. Here’s a sample:


USD U.K. £ CAD Euro AU $
USD 1.00000 2.05639 1.01142 1.48250 0.87440
U.K. £ 0.48629 1.00000 0.49184 0.72092 0.42521
CAD 0.98870 2.03316 1.00000 1.46574 0.86452
Euro 0.67454 1.38711 0.68225 1.00000 0.58981
AU $ 1.14364 2.35177 1.15671 1.69544 1.00000

* (USD to CAD element was changed from 0.98870 to 1.0 in the example below)

The data is essentially a matrix as follows (with a bit of rearranging and reducing the number of currencies):

FX table

C for Canadian Dollar
U for US Dollar
E for Euro
CU: price of 1 Canadian dollar in US dollars as reported in the table
UC: price of 1 US dollar in Canadian dollars as reported in the table

FX-table multiplied by itself

This matrix, in an efficient, arbitrage-free market, should simplify to:

Ideally The Result should simplify to this.

Therefore, the test is to form the Foreign Exchange Matrix, and then calculate the following expression in Matlab, Excel, etc:

Test formula , where n is the number of rows in the FX table. (3 in the above example)

If the resulting matrix has non-zero elements, it is theoretically possible that arbitrage can happen. Note that “non-zero” is relative as it is unlikely that you get all zeros because of round off errors. But, dividing (the absolute value of) the biggest element by n gives you a good idea about the potential amount of arbitrage. For example, applying the formula to the sample data at the beginning of the text shows that the inconsistency in the table of rates is, more or less, about 0.678%. (Again, the sample table was tampered with for the sake of the example. Using the original data, the arbitrage potential was 0.00068%.)

I recommend that this formula be used for a quick test as opposed to a full diagnostic review of your FX table. There are definitely better and more elaborate ways of arbitrage detection and pinpointing what algorithm can make you the most amount of money. This post is only meant to show how a little bit of Linear Algebra can be used as a quick test of online data.

Also, the chances of making money this way is very low. That is because markets are quite efficient these days. Also, all FX trading accounts have a trading spread which is basically charging you a small premium every time you do a trade. This small amount is large enough to cover the arbitrage opportunity as detected above. If you know of a trading account that isn’t like that, I would love to know about them ;)

Let me know what you thought of this post. Do I have what it takes to be a Quant!? If you’re interested in the spreadsheet that does the calculations, let me know.

6 Comments »

  1. Good post :-) I just don’t get to use matrices enough anoymore…

    Comment by Geoff — November 24, 2007 @ 12:15 am

  2. In my Advanced Algorithms class, we did an assignment problem that used a min cost max flow formulation of foreign exchange arbitrage (Problem Set 5, Problem 6: http://courses.csail.mit.edu/6.854/current/). I think this is a somewhat better formulation than the simple matrix approach you describe, since the “flows” from one currency to another can take arbitrary paths.

    Of course, making this actually *work* is far more difficult. Not only is there the trading spread, but the rates vary over time. Still, my understanding is that application of techniques like this is basically how some people make tons of money on Wall Street.

    Comment by Evan Jones — November 24, 2007 @ 6:27 pm

  3. Very little immediate arbitrage currency trading does occur. That’s because as soon as the opportunity is detected the markets are fairly efficient and the supply/demand factors will force abritrage back into existance.

    It’s easier to make profits off of currency differentials in two ways:
    1) Arbitrage off of cross-listed stocks. I.e. if the exchange is not properly accounted for (which often happens when you’ve got small caps trading on TSX Venture, Nasdaq, the London one whose name is slipping my mind) it doesn’t trade often enough to price in the currency diff so you can often make money by buying and selling opportunistically off of the spread
    2) Good old fashioned expectations and derivative products that take advantage of that.

    But Sahand - if the entrepreneur thing doesn’t work out you could be one hell of a prop trader!

    Comment by Risa — November 25, 2007 @ 9:35 pm

  4. Thanks for your comments everyone. This is encouraging.

    Evan, I agree. Besides indicating the “flow”, using the min-cost-max-flow approach, you can fully simulate reality by eliminating currency conversions paths that are not possible. E.g. using my existing FX accounts, I may not be able to convert from Yen to CAD without having to go through USD. Also as Risa pointed out, the Matrix multiplication only detects immediate arb.

    Risa, that’s pretty useful insight about futures markets. I don’t pretend to know this, but I’d heard about this price inconsistency before and I think for smaller ventures it provides better returns (risk? not sure about that one) E.g. buying GM stocks based on oil future trends, etc.

    Comment by Sahand — November 25, 2007 @ 10:12 pm

  5. Can these strategies work on all currency platforms? I am new to trading and just learning how to use many of these strategies. I am still looking for the right platform. Some traders have suggestes using metatrader or x trader. Has anyone worked with either? Of which platforms have you used. Thanks, Brian.

    Comment by Brian Seabrook — February 14, 2008 @ 9:40 am

  6. I am interested in learning more about forex trading signals and learning how to predict these moves. My friend has told me you can predict forex through a handful of platforms. Have you used any? Thanks, Jeff.

    Comment by Jeff Ronk — February 20, 2008 @ 9:35 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

© 2007 Sahand Sojoodi
Powered by WordPress