Programming for investment managers

Being able to comprehend and ideally write code has become an important skill in almost every industry over the past 30 years. This is especially true since the breakthrough success of personal computing and eventually the internet in the mid-1990s. More recently, cloud computing and Big Data have boosted companies’ reliance on programmers and data analysts to a whole new level.

In the finance profession, for example, programming in a scripting language has become a common task for quantitative researchers, risk managers, asset managers and, yes, even traders. For data analysts, financial markets are a dream-come-true because market participants’ trading activities produce a constant stream of information, most of which is instantly available in numeric and machine-readable form. The amount of data produced is so vast that analysing the data manually is practically impossible, hence requiring analysts to be able to code so computers can do the work for them.

Geeks (or “quants”, as they were warily called by old-school traders in the 90s) have consequently become a hot commodity in the banking and hedge fund world, despite their involvement in recent market meltdowns, such as the subprime mortgage crisis and the Flash Crash of May 2010. These setbacks notwithstanding, it is undeniable that diligent statistical analysis can add significant value to investment management in the long run, as proven by the real money track record of hedge funds and commodity trading advisors (CTAs) such as AQR, Winton Capital, AHL, the lesser known Millburn Ridgefield or the legendary Renaissance Technologies, although the latter is arguably impossible for outsiders to look into and hence judge objectively based on actual performance data.

Considering the importance of statistics and data analysis for today’s asset management profession, I decided to add a “programming” category to this blog. I’m going to write tutorials and code examples for certain programming tasks that you might encounter in the investment profession as well as educational posts about language fundamentals, focussing on MATLAB, Python and R, all of which are commonly used by quants throughout the hedge fund world.

Euro depreciation continues after Draghi speech

As I wrote only two days ago, I was waiting for the EURUSD exchange rate to hit $1.0765 and $1.06 before closing my short positions. I would not have thought that both of these take profit limits would be hit within a mere two days. So as a follow-up to Monday’s post let’s take another look at the monthly EURUSD chart.

EURUSD Monthly Chart 11/03/2015

EURUSD is currently trading at $1.0583, which means that all of my short positions have now been closed. Considering that the exchange rate is at a point where two trend lines — originating from the year 2008 and 2000 respectively — cross each other, I’m going to wait and see where it will go from here before opening new positions. As of now, I’m biased towards going long given that the euro appears oversold on a short-term horizon. A move towards $1.2 would not be unusual after such sharp declines, although both economic fundamentals and central bank policies clearly speak against such a level right now. Perhaps it is more likely that we will see $1.1 in April or May before falling back towards parity by the end of 2015.

Today’s extended drop in the relative value of the euro was ignited by Mario Draghi reiterating at the 16th “The ECB and its Watchers” conference in Frankfurt the ECB’s commitment to reach its long-term inflation goal and to bring the central bank’s balance sheet back to $3 trillion through 2016. The key statement:

Our decision in September to make use of asset purchases had significant effects. But still, when we announced the purchase of asset-backed securities (ABSs) and covered bonds, there were some in the market place who doubted our commitment and the effectiveness of our monetary policy. They thought we might be hampered either by there being a limited availability of assets that we could purchase in the market or by legal or political obstacles to our ability to expand the range of assets, should it become necessary. If we were so constrained, that would affect our credibility because our ability to anchor expectations relies in part on the fact that we are free to set the appropriate monetary stance.

In this context, the decisions we took in January to expand the range of our asset purchases must have assuaged those concerns. We can deploy – and we are deploying – monetary policy in a way that can – and will – stabilise inflation in line with our objective.

The yields of European countries’ government bonds have fallen further since the ECB started its asset purchase programme on Monday. For instance, Italy’s 10-year bond yield is now at a record low 1.17% after having fallen below 1.25% yesterday. The yield of German 10yr government bonds is just 0.205% as of this writing (German government bonds with shorter maturities have offered negative yields since the beginning of the year and have since fallen even further into negative territory).

Italian 10yr generic bond yield 11/03/2015

As long as market participants believe that the ECB will be able to achieve its monetary policy goals, there is no apparent reason why the euro should appreciate significantly in 2015 and 2016. My medium-term EUR bias remains firmly short.

Only the Federal Reserve would have the fire power to steer the EURUSD exchange rate in an upward direction, but that is not going to happen unless the United States begin to see the strong US dollar as a valid threat to the nation’s economic recovery. That has not been the case so far, despite a few comments from US officials about the euro being artificially undervalued as a means to support European exports. One can only hope that the Federal Reserve will not deviate from its plan to raise interest rates in 2015, because anything else would likely mean an engagement in a full-blown global currency war with unknown consequences.

ECB starts QE programme

The European Central Bank (ECB) started its 1.1 trillion euro QE programme today at 9:25am Frankfurt time by purchasing German and Italian government bonds. While bond yields expectedly fell further, the euro remained almost unchanged.

The EURUSD exchange rate is trading at $1.0852 as of this writing — having fallen sharply below $1.10 after Mario Draghi’s press conference on Thursday last week.

EURUSD Monthly 15-Year Chart 2015-03-09

The euro remains a sell versus the US dollar. From a technical point of view, the next support level is the September 2003 low at $1.0765. A more significant support should be the crossing of the upward and downward sloping trend lines in the $1.057-1.060 area. The geopolitical and economic situations in and around Europe are not supporting the single currency, either. Greece remains a bottomless pit that European politicians continue to throw money into. Greece’s list of proposed measures to counter its dire state was rejected by the country’s creditors — perhaps understandably so considering that the list contained such unconventional measures as “hiring non-professional tax collectors, such as tourists”. The Russia/Ukraine conflict weighs on investor sentiment, too.

Taking all this into account, I still believe we will see parity by the end of this year, but a short-term upward correction becomes ever more likely. Euro bulls should perhaps wait until one of the above-mentioned support levels has been reached before adding euro long positions, because the trend is still very much intact. On the other hand, I would be very careful with entering into new EURUSD short positions at current levels. Personally, I choose to keep my existing short positions with a 50% take profit at $1.0765 and another 50% take profit at $1.06. If the exchange rate indeed turns around before reaching those levels, I’m prepared to add to my short positions once we get back into the $1.11-12 region.

The word is spreading: Denmark is not Switzerland

Since the SNB failed to maintain its CHF cap on 15 January no day goes by without new headlines about leveraged hedge funds betting against the EURDKK exchange rate band. Denmark’s central bank has so far been able to fend the specs off quite successfully. As I wrote last week, the cases of Denmark and Switzerland are just too different and should not be compared due to two facts:

1) The DKK is part of the ERM II. That means both the Danish central bank and the ECB obligated themselves to defend the EURDKK tolerance band.

2) Denmark’s economy is not nearly as solid as Switzerland’s to justify that much DKK appreciation versus the euro even if the peg were to break down. Unlike the CHF, the DKK is no safe haven currency.

It’s good to see that more people are trying to talk some sense into the EURDKK short speculators, like Marc Chandler did in his commentary on Seeking Alpha.

January 2015 Nonfarm Payrolls lift USD

Yesterday the U.S. Bureau of Labor Statistics (BLS) reported that total nonfarm payroll employment increased by 257,000 in January 2015 and that the unemployment rate rose to 5.7% from 5.6%. The market had been expecting an NFP release of roughly 228k, according to a Bloomberg survey of economists. In addition, the BLS revised the November 2014 NFP number to 423k from 353k. The preliminary December 2014 revision stands at 329k versus the original release of 252k. That suggests that more than 1 million jobs may have been added in the nonfarm labour market since October of last year, painting a more optimistic picture for the US labour market.

2014 Revisions in Nonfarm Employment
2014 Revisions in Nonfarm Employment (Source: U.S. Bureau of Labor Statistics)

The increase in the unemployment rate may surprise some analysts considering the strong NFP print, but the change may merely have been a result of a disproportionate 0.2% increase in the labour force participation rate (62.9% after 62.7% in December 2014), which is encouraging given that slightly more people are now looking for opportunities in the improving jobs market.

When the number came out at 1:30pm London time, the USDJPY exchange rate jumped almost instantly to Y119 all the way from Y117.2 and EURUSD fell more than one cent to $1.1311 from $1.1459. Currency traders certainly cannot complain about a lack of volatility in the FX market in January and the first days of February. Intraday swings and the return of lasting price trends have provided many trade opportunities for investors. I still expect EURUSD to trade somewhere between parity and $1.1 by the end of the year. The case is similar for USDJPY with the Bank of Japan still set on printing more money to aid its economy. The strong employment numbers from the United States put a possible first Fed rate hike in mid-2015 back on the table.

FX Market Trends