The Gateway to Algorithmic and Automated Trading

The Automated Trader Interview

Published in Automated Trader Magazine Issue 23 Q4 2011

"Gold is a key component of every investor's portfolio", says Cristiano Migliorini, head of quantitative research for Union Bancaire Privee (UBP)'s UBAM Gold + Fund. "Gold provides an effective hedge against monetary debasement, inflation and equity market shocks. Yet, simply going long gold has disadvantages." So how do you invest - trade - advantageously in gold, and what role does automation play in the process? Andy Webb went to meet the UBAM Gold + team.

From left to right: Andrea Gentilini – Fundamental Research Cristiano Migliorini – Quantitative Research Anne Mikulovic – Operations Manager Rui Brandão – Product Specialist Eric Schreiber – Head of Commodities

From left to right: Andrea Gentilini - Fundamental Research, Cristiano Migliorini - Quantitative Research Anne Mikulovic - Operations Manager, Rui Brandão - Product Specialist, Eric Schreiber - Head of Commodities

Andy Webb: One thing I should clarify before we start. I realise that your processes are not, as yet, particularly automated, but you're certainly quantitative, and my understanding is that you are interested in taking some steps towards automation in the future. Is that correct?

Cristiano Miglorini: If you're referring to automated execution, that's something we don't have, and I'm not even sure that we will ever implement it. One problem would be, we'd have to trade in liquid markets. Gold is very liquid - the problem is more with platinum and palladium. But we do have a number of steps that are automated. The signals are partly automated and flashed to the trader. In addition, we are working with the Bloomberg EMSX team to automate post-execution tasks. EMSX is a single-point-of-entry messaging interface where you enter your orders for multiple brokers, for multiple trade management. What they are developing now is a Java-based API that allows our systems to communicate with them, retrieve the information, generate the signal, prompt us to trade but also verify the execution. But we don't fill the ticket automatically*.

*CM: The EMSX tool has some security checks to avoid undesired algo trading. So it is relatively easy to manage the post-execution; but to manage algorithmic execution some steps are required with the brokers.

My point is, we are working on quite cutting-edge stuff, and we are looking to integrate this with Matlab. The advantages are speed, the wealth of data we can collect, the extent of automation we can get. The performance of such a system is professional and robust. The drawback is that this is so new that they're still modifying the API that has just been released; it's as if using it is still testing it. We approached Bloomberg to explore possibilities and we analyzed the EMSX concept and Tradebook. These are two different groups within Bloomberg, very dynamic and competitive. Tradebook is great if you have a portfolio of equities or a portfolio of bonds - stuff that is relatively standard. It's a really nice system that offers you a lot of scenarios and advanced risk analysis, but the problem with us is that we have a portfolio of options on metals, which are non-standard.

When you look into a portfolio like ours, where in fact we have several different instruments, forwards, metals, spot, futures and complicated options, you are immediately out of that remit. Unfortunately, this makes Tradebook useless for our purposes.

Andy Webb: The connectivity to some of the markets you're talking about is not there. I reviewed the Tradebook API a while back (Issue 18 Q3 2010). It was still in the early stages, very good, excellent documentation, very robust, but OTC options - no.

Cristiano Migliorini: And we need to integrate scenarios in real time that are beyond its capabilities. We said, get off any third party tool and do everything with our own systems. Now we use the Bloomberg EMSX because it gives us a simple and open execution interface. It allows us to route to any broker we want, and it's flexible. We started to interact with the EMSX team, and they are pushing to expand their own API. When I get the connection, Matlab to Bloomberg, I can get real-time data in a fraction of a second. That means, even if you want to hedge your book with high frequency, you are probably down to well below a second between pulling the data and executing, if that's what you want. That's pretty good, given the low cost and the range of services. If you want to trade at super high speed, forget it, but it is a very convenient set-up. They are developing it, we are developing the interface between their system and Matlab, and it's fun.

Andy Webb: Let me get this clear. You're not using the standard Matlab/Bloomberg toolbox?

Cristiano Migliorini: No way. The standard one is a nice tool. It's Java-based, it allows you to do a range of operations, it's good. But the new stuff is completely unsupported. Keep in mind that the size of the API that I'm testing now is about 80 per cent larger than the original one. There is plenty of stuff inside it.

Andy Webb: What's the additional functionality?

Cristiano Migliorini: From Matlab you can get historical data, real-time data. Now, what you get from EMSX is all the execution interface. Even if you manually execute the trade, the Matlab system will say - okay, this trade was executed, etc. Our first step is to build straight-through operations, so if a trade is executed, we want automatically to map it on our position-keeping system and calculate the new risk.

This is custom built by us and Java based. As soon as you trade at a certain frequency, at a certain volume, what you want is good book-keeping and real-time risk. What the API allows is fully automated execution if we want it. These are the new functionalities that we are exploring.

Andy Webb: With the new API, the order-fill information it's sending back - are you sending that back through the API, through Matlab, and then on to your back-office systems, or are you making a direct connection between the API and your back-office systems?

Cristiani Migliorini: We will develop a code in Matlab - most of it is Java but some of it is Matlab - and then compile the code and probably either we create an executable file, an executable application, or we will develop a component that links to some other existing code; but I've got to say, this is deployed Matlab, it's executable, it's binary code at the end.

Andy Webb: You're writing it mostly in Java, or you're writing it in Matlab, or … ?

Cristiano Migliorini: We write Java for all the communication part and Matlab for all the computational part. So all the retrieval from the database and from EMSX is through Java. But as soon as we are in Matlab, we do all the calculations in Matlab. The final application that we deploy is a binary, which is in C code for efficiency.

Andy Webb: So are you running the C code as native C code or as MEX files in Matlab?

Cristiano Migliorini: Native. Everything at the end is native. The advantage of our approach, of having the Java input/output and Matlab in between - to give you an example, we are using both 32-bit and 64-bit systems for legacy reasons, and all the codes are absolutely portable. Just yesterday, we shifted something to the 64-bit machine, and all we had to do, we took the code, we recompiled it on the 64-bit machine, and it ran straight away. Fantastic.

Andy Webb: That is a huge timesaver, isn't it? One question: are you just running Windows 32-bit and 64-bit, or are you running Linux as well?

Cristiano Migliorini: We have developed systems complying to the bank IT guidelines. In addition, we also need to generate readable reports for our independent administrator, so we are on Windows.

Andy Webb: Oh no! It's so much more efficient and it doesn't fall over the whole time. They really won't allow Linux in the building?

Cristiano Migliorini: It is a matter of trade off between implementing a Linux solution and having all the administrative burden of make everything available to auditors, compliance officers, risk officers, performance reporting, administrators who supervise the fund or waiting to have Windows 7 fully deployed in the bank, based on positive experience on Windows 7. We chose the latter.

Andy Webb: You are making use of Vista, aren't you?

Cristiano Migliorini: On our desk we have XP. If you start developing with your objective in mind, then you make your code and you make your systems such that you can move from one system to another very rapidly. You are absolutely right on Linux. But you have to reach out to the rest of world, which is Windows based.

Andy Webb: It's a stability thing with Matlab as well. I run both. I run Windows 7 64-bit Matlab, and I also run Linux Red Hat Enterprise with Matlab on, and I've just never had any sort of memory leak, I've never had Matlab crash on me, I've never had anything go wrong on the Linux machine, ever, and it's actually running live trades. I just use 64-bit Windows for testing and simulation.

Cristiano Migliorini: If you have your own hedge fund, you can do what you want - I should say "you could" since investors will increasingly demand transparency. We want full transparency on the operations of the fund. By the way, some of our routines, where we calculate real-time risk, are running on graphic cards.

Andy Webb: Ah, you're using GPUs. Who are you using? Nvidia?

Cristiano Migliorini: Yes, I am using Tesla cards.

The UBAM Gold + team

Eric Schreiber, head of commodities, joined UBP in May 2010 after 16 years at Credit Suisse. Eric grew Credit Suisse's home based commodity derivatives trading operation in precious metals as well as base metals, energy and agricultural commodities. His team spanned the spectrum from physical bullion vaulting, to interbank dealing in spot, forwards, and options, to structured products and exotic derivatives for in-house and third party private banks. Eric traded the bank's precious metal book prior to managing the bank's structured commodity, exotic derivatives and global commodity correlation books.

Cristiano Migliorini, quantitative research, joined UBP in June 2010. Cristiano is a recognised expert in modelling and has published in journals such as "The Economist" and "Nature". He has significant expertise in quantitative methods applied to system modelling, with a particular experience in sentiment trading. He focuses on technical research (encompassing systematic strategy development) for the commodities team.

Andrea Gentilini, fundamental research, joined UBP in August 2010 from Barclays Capital in New York where he built and led the firm's strategic consulting business, managing a global team of investment banking, trading and management consulting professionals focused on developing hedge fund (HF) industry research and delivering advisory services for HFs.

Anne Mikulovic, operations manager, joined UBP in 2010. Anne oversees all fund operations and mid-/back-office functions, including trade and valuation reconciliation with fund administrator and depositary bank and fund subscriptions and redemptions. Also, she is responsible for counterparty onboarding and counterparty risk mananagement.

Rui Brandão, product specialist, has a 10 year cumulative tenure with UBP. He developed and managed the hedge fund secondary market platform within UBP's Fund of Hedge Funds. Then, he integrated UBP's Private Equity Team within the bank. As commodity product specialist, Rui is responsible for investor relations and marketing activities. Prior to joining UBP, Rui worked as a foreign exchange trader with Capital International SA.

Andy Webb: Same here. Very good, I find. To be clear, you're using the Tesla slot-in cards in each machine. How many cards?

Cristiano Migliorini: We use an eight-CPU, 4-card unit, 2 by 1 architecture.

Andy Webb: Four cards into a unit. We manage three. Do you have fun with the drivers?

Cristiano Migliorini: No problem at all. This is custom-built, to my specs. We have 48 gigabytes of RAM. It's a very, very powerful station. It stays in a cooled room with the other servers, and runs Windows 7.

Andy Webb: That's really interesting. Did you have - sorry, this is getting slightly off track but I'm really interested - did you have any problems sourcing a motherboard with enough PCIx 16 slots? We had real grief, and in the end we could only get a motherboard that would take three cards, and even then, that only left us one slot for the video card.

Cristiano Migliorini: No way, no problem. The IT group of the bank understood our needs and they got it, they delivered. The machine is not even a year old.

Andy Webb: Ah, I see. We've had ours for a couple of years, and that may be why we couldn't get a machine with enough slots.

Cristiano Migliorini: We call the machine 'The Beast'. It's in the background somewhere, always doing calculations.

Andy Webb: Are you writing your own code?

Cristiano Migliorini: Yes.

Andy Webb: So you're not using something like AccelerEyes in Matlab?

Cristiano Migliorini: I was thinking of using that, but I find it an overkill for what I have to do, which is building big random-number matrices. From September last year, with 2010b, it was already possible to work on Matlab seamlessly with graphic cards. AccelerEyes offers you much more functionality, but I just need the random-number matrix. I find it straightforward.

Andy Webb: We use AccelerEyes here and it's absolutely great for what we do. You have this enormous machine running in a server room. You're using it for random-number generation - for what, exactly?

Andrea Gentilini: Creation of risk scenarios. We want to see what happens if price moves, if correlation moves, if volatility moves, which for us is important. When you model volatility moves, you can say that it goes up and down, that's a parallel shift, but what we use for pricing all these options are the full volatility surfaces of the metals. You can squeeze the surface, the surface can go up and down, the surface can be twisted in many ways, you can technically call it skew but then you enter into more sophisticated analysis. When you have instruments like knock-outs, one-touches, variance swaps or other exotics, you should take a look into these risk assessments. It's impossible to run them real-time on a system that is used for trading, so we have to run them in the background, store the results, and make them available on demand.

Andy Webb: You're calculating the data on the remote system, but the data is only delivered on a per-request basis; you're not trying to stream the data in any way.

Andrea Gentilini: That's the basic concept.

Andy Webb: In practice, how many requests do you typically have per minute?

Cristiano Migliorini: We only calculate every minute maybe. It depends. At the moment, the book has very little risk, so maybe in this hour nothing happens, nobody's requesting, but in a fast-moving market, maybe you want to request every two minutes, to refresh, and then maybe enter a trade depending on what the signal is.

Andy Webb: How long does it take The Beast to run a complete recalculation?

Cristiano Migliorini: There are several different processes. Once the system is up and running, we are down to less than a minute to refresh the risks. We have start-up operations every day, and these require a good hour. Then we have overnight calculations, and these require six, seven hours.

Andy Webb: That's an awful lot of vol surfaces you must be playing with.

Cristiano Migliorini: Yes, metal and forex. Overnight we do some optimisation, which again is all done in Matlab, very efficiently with parallel genetic algorithms. Overnight is the heavy-duty stuff; morning is a refresh with the new data start-up, and in the day, it's simply a refresh.

Andy Webb: The first refresh in the morning - that refreshes all the data from the previous day?

Cristiano Migliorini: It's the data from the night, and the new data from the morning.

Andy Webb: Tell me about the optimisation; what are you optimising?

Cristiano Migliorini: Most of the time we are working on the volatility surfaces and trying to find the best fits, so our models fit these surfaces, and then these models are the ones we use to calculate our risk profile during the day.

Andy Webb: You're using two different strategy streams, the beta and alpha streams. The beta stream, the long core gold exposure, are you doing that mostly through physicals, or through futures, or what?

Cristiano Migliorini: During the month, we would do that mostly via futures, but towards the end of the month, we would consolidate the position, take out some of the futures and put in the physical, because we want the fund to have a strong physical backing. We want the fund to be structured in such a way that, whatever happens to the financial world, whatever happens to our own institution and to the custodian bank, the customer has the guarantee to get their respective NAV, and the only way to do that is to have a strong physical backing.

Andy Webb: Yes, reassigning a futures contract doesn't look so attractive when you can just give them a slab of gold.

Eric Schreiber: If the worst comes to the worst, a future is a piece of paper saying, I owe you some gold. As you know, the volume of futures traded is much higher than the physical gold available on the planet. To avoid a physical squeeze, we think it is correct to protect the customer by having a physical backing of gold in a vault in a safe jurisdiction like Switzerland. That's why, towards the end of the month, we always rebalance into physical and we keep a little bit for trading. The fund is always 80-85% backed by 12-kilobar gold bars. This allows you to have your 15% as collateral for trading, which is more than enough.

Andy Webb: The 15% that you're using for other strategies in the alpha stream - you've got uncorrelated strategies in gold-related markets, other metals, mining equities.

Eric Schreiber: Yes. Gold, silver, platinum, palladium, and some mining equities.

Andy Webb: The silver, platinum and palladium - are you trading those as outrights, or are you trading them as spreads against gold, or …

Eric Schreiber: Normally, relative value against gold. We might, say, go 5% long silver, 5% underweight gold with respect to our target. This would be relative value. Or we might say, no, wait a minute, gold and silver are correlated, there's a certain beta correlation; however, their volatility, in this moment, is out of synch. It doesn't match the beta. In that case, we might sell, say, volatility of silver and buy volatility of gold. We arbitrage the volatility of the two. So there's the price move and the volatility move; a third is the correlation move. We might think the correlation too high, say, so we sell just that, the correlation.

Andy Webb: You're trading the mean reversion, mean expansion of the correlation?

Eric Schreiber: Mean reversion, but of a different dimension, price, volatility and correlation.

Andy Webb: Are you simply using correlation modelling, or do you get into such things as co-integration as well?

Cristiano Migliorini: For the time being, we just use correlation modelling. It's simple, it's stupid, but …

A dream of automation

"Hopefully this is my assignment for the coming year. I have a dream to continue with my studies on trend-following strategies, and to come to a fully automated trading system. To do that on top of what we do, on top of the volatility. This is something we have been discussing, so I know what we should be doing, I know the kind of research we should be doing, and that's the dream. I have already developed most of the back-testing systems in Matlab. This is where my heart lies."

Cristiano Migliorini.

Andy Webb: Hey - it works!

Cristiano Migliorini: It can be explained, it's understandable. You buy or sell a basket of options, then you hedge with underlying vanilla options, then you still have a residual delta that you have to balance every so often.

Andy Webb: I find that really interesting because you touched on a point - I'm sorry, this is going off at a tangent, but it's a point that's occurred to me in the past when I've been talking to other traders and quants. They have a very good strategy, very good alpha, but it's actually quite complex. They're saying to me, why can't we attract more investors? We have so much trouble attracting investors, look at our returns and so on. I sometimes think: actually, most investors aren't going to understand one word of what you are doing. So they get scared and won't take it.

Cristiano Migliorini: Another dimension is, it depends on where you play. If you go into equities, you may find a horde of people trying to do something in equities. If you go into metals, and especially if you trade physical metals - we can buy silver futures, for example, but we can also buy physical silver - the player space in metals is simply much smaller, and the space is, if you like, primitive. It's a relatively small market with some archaic rules.

Andy Webb: It's a club for old men so they can carry on still making money past their retirement date.

Cristiano Migliorini: Until a few years ago, the fixing was still done with little flags. It's an interesting market and it's complicated. If we go back to the original point, if you trade equities, you can use Tradebook, or whatever. Relatively easy to book, relatively easy to manage the operation. As soon as you trade metals, you enter into a space where you have options, futures, forwards, physical in a metal account, physical in bars. You have to manage the operations of a fund of this complexity. The barrier to doing that is much higher than it would be for trading in equities or bonds.

Andy Webb: But that is good in a way, because if you have the expertise to do that, as you guys do, you don't exactly have a private space, but you do have a space in which you're not competing with three million other people trying to do the same thing.

Cristiano Migliorini: Exactly. But there is complexity. The fund manages a half billion dollar assets, and offers daily liquidity in three currencies. For example, the fund is doing very, very well in Swiss Francs. We made 23 per cent in Swiss Francs just in the past nine months, which is great if you consider how much the Swiss Franc has been appreciating itself, but to manage daily inflows and outflows in six share classes, and to manage the operations for settlement requires significant attention and precision. For example, today we have four options at settlement in the book; right now, we have about sixty options, and that's just the vanilla part of the book, then we have the exotic instruments like the baskets, which would add another ten options. There's quite a complicated machinery behind all this.

Andy Webb: You mentioned share classes. Another tangent: how are they split?

Cristiano Migliorini: By currency and then between institutional investors and retail. Sometimes I think about CTAs, people who are playing simple futures. The set-up of their operations is relatively easy. They can go easily for managed accounts, the set-up of the fund is relatively easy, the accounting is straightforward, the marking of the futures prices is univocal. On top of that, most of these funds or accounts offer a monthly or bi-monthly liquidity. But after the crisis of 2008, most investors want daily liquidity. So we have set up a lot of operations, a lot of systems that are automatically handling all operations. I like to compare the fund as we have it now with a very nice, super-sophisticated yacht. One man at the helm can do everything by just pushing a button, without a crew. The fund is at the point where all these daily operations, even in the worst case, can be managed by one person.

Andy Webb: That's an interesting analogy …

Cristiano Migliorini: I don't know whether people realise how much work has gone into that. This has all been programmed by us. It's automation, but not sexy automation.

Andy Webb: So you've programmed the systems in-house to do all that?

Cristiano Migliorini: Completely. The three of us working on it. It has been a huge, huge task.

Andy Webb: So now you're able to offer daily liquidity in multiple classes to two categories of investor, institutional and retail, in three currencies.

Cristiano Migliorini: Yes, US dollars, Euros and Swiss Francs. We plan to add Singapore dollars soon; the fund is registered in Singapore and we want to attract clients in Asia. Adding a currency with our level of automation is easy.

Andy Webb: How do you manage your FX volatility across share classes?

Cristiano Migliorini: That's strictly done in an algorithmic way. It's not automated, but it is all coded. It has been working very well.

Andy Webb: I have been astonished at the number of asset managers who leave that to the custodian to do.

Cristiano Migliorini: We are very privileged to have very good team at the FX desk with us. We deployed our system to them, so we have straight-through processing: the system proposes the trade, they verify, execute and enter the trade themselves into the system. We always have a double check on all operations, so someone else will check the trade, check the broker's confirmation and approve it - we have an affirmation process. We have two kinds of FX trades: inflow and outflow, FX conversion; and FX hedging.

Andy Webb: Most of the contracts you're trading are presumably US dollar-denominated?

Cristiano Migliorini: The fund itself can trade in US dollars, Euros and Swiss Francs. In the past, we have traded in Euro-denominated gold, recently in Swiss-gold; you buy or sell a call on eurogold. You can trade that from an FX perspective, or looking at eurogold volatility versus US dollar gold volatility. You have a spread of volatilities between the two embedding the FX risk.

Andy Webb: You're not short of trading opportunities, are you?

Cristiano Migliorini: The space we have is relatively small. What matters is the way you look at the space. You can multiply the opportunities by forcing yourself into the niche and looking at it really in depth.

Andy Webb: Even though you're in the 'gold complex', you actually have multiple trading opportunities with equity curves that are absolutely non-correlated.

Cristiano Migliorini: Absolutely. The fundamentals supporting the gold bull market are very strong…

Andy Webb: Cristiano, thank you very much.