Friday, 20 November 2015

Fifty six – Python for Quant Finance

I missed the Richmond Scenic Cycling event; I had been working constantly: there had been an emergency at the office. I needed to chat to human resources, figure out procedures, speak with colleagues and send endless emails. A part of me screamed: ‘You must go to a Meetup! Forget your job! Your quest is what is important now!’ I felt anxious and started to imagine scenes where I were pulled into a meeting and asked an inevitable question: ‘So, why don’t our students have a tutor? Where is their support? Isn’t this your job to organise things?’

I was putting myself under pressure with the quest and the pressure of my job was growing. For two days, I had got up at eight in the morning and shut the computer down at nine at night. I did this because I wanted a whole day to myself so I could go to a daytime Meetup. Number fifty six, I told myself, would be my reward after I had solved a whole raft of issues.

‘Can I have you name please?’ asked the receptionist of a multinational financial information company.

‘I’m not on the list. I signed up at the eleventh hour’, I said, showing the receptionist my phone, which contained an email notification. I again applied the tactic of hiding the line that said I was on the waiting list. She nodded, satisfied. ‘Sit down over there. Sarah will be with you in a moment to show you upstairs’. The receptionist gestured to leather chairs that were an extraordinarily long way away from the reception area.

Just as I had sat down, Sarah arrived. Sarah took myself and two other people through security. I was impressed. I gave my name and showed my driving licence so they could check who I said I was. They then took a picture of me and handed me a personalised visitor badge.

After passing a security guard, I took an escalator to what appeared to be a busy café area, where I then met another security guard. I asked for some directions, and then went down a flight of stairs to what appeared to be a cavernous area that must only be used for speeches and entertaining.

I then caught sight of a meeting room. I could see people setting up laptops. I went inside. I had found my destination.

The Meetup was all about Python for Quants. Python is a general purpose computer programming language that is becoming increasingly popular. It’s also a language that I have never used and didn't know very much about. ‘Quants’, which is short for ‘quantitative’, is a label used for city and banking whizz-kids who use computers to process data and crunch numbers. Taking a more cynical view, quants are super-clever maths and physics geeks who create systems that could inadvertently destabilise the global economy.

‘Okay, thanks for coming everyone!’ announced Stefan, the group founder and hack-fest leader. ‘You would have probably seen a list of projects on the group website. I’ve suggested data analytics, risk management, visualisations, data streaming and automated trading, but there might be others that you want to look at. Perhaps we could just go around everyone to ask what you’re interested in?’

There were twelve of us. Data analytics (whatever that meant) was popular, but there was a smaller group that was interested in automated trading. It was soon my turn. Honesty, I thought, was the best policy.

‘Hello everyone, I’ve never used Python before, and I’m not a quant, and I don’t know much about how Python is used by Quants… and that’s why I’m here.’ I looked around the room. There was silence. Stefan’s expression was one of faint bemusement. ‘I am, however, a former Java developer…’ I immediately wondered how that would go down. I paused for a moment, assessing the room. I wondered what Python developers thought of Java developers. ‘I can leave now, if you want...!’ I said. Everyone laughed; the ice had been broken.

After the ‘introductions by way of projects’, Stefan gave us a quick demo of a baffling bunch of software tools that I had never seen before. He talked about on-line plotting libraries and how to code web apps. I was assaulted by new terms: data as a service, analytics as a service and Python running in a ‘flask’. Some of it I followed, most of it I missed. Plus, I started to feel like an idiot: I sorely regretted not bringing my laptop since it was clear that I needed to try stuff out.

Towards the end of Stefan’s demo, we were introduced to some freely available data sources. Thousands of stock price numbers flashed across an overhead projector. Functions were written to put numbers into data stores that were then magically converted into graphs. Neat lines were added to show trends. I felt as if I was being exposed to an entirely new subject; a new dimension of computing that I knew existed but I had never properly engaged with.

It was time to work on our projects, but the hackers didn’t really know one another. Silence hung steadily in the room, each visitor pushing buttons on their own laptop, everyone collectively and silently trying to figure out how all these new tools worked.

I chatted to Krishna, who sat on my right. Krishna used to work in a bank, but was currently self-employed, and enjoyed messing around with Python. He was interested in algorithmic trading. I asked him about the ‘kind of strategies’ he wanted to implement, and he rattled off a whole set of names, one of which I remembered from the ‘Women who Code’ Meetup; something about software looking that the rate at which share prices change.

Saban, who sat on my left, was interested in ‘BitCoin arbitrage’. A BitCoin is a set of numbers which you can ‘own’ which have been discovered (or ‘mined’) by a magic algorithm. As far as I understand it, these numbers can then be bought and sold on exchanges for ‘real’ money. Saban realised that different BitCoin exchanges advertise different rates. His project was to figure out how to visualise the differences between various exchanges with a view to finding discrepancies.

I remembered something else I picked up from the ‘Women who Code’ group: since different exchanges advertise different rates, if you do trades fast enough to exploit these differences, you can make money. This made me think about a couple of related questions: ‘who do these actions or trades ultimately impact?’ and ‘what is money?’ I never studied economics, but the longer that I sat in that room, the more ignorant I felt.

‘Okay, who wants some lunch?’ announced Stefan into silence that was punctuated only by the tapping of keys.

Lunch was great; several platters of fancy sandwiches, rocket and parmesan salad, beetroot and quinoa seasoned with herbs, moistened with Italian extra virgin olive oil. It was a lunch that was good enough for banking executives. I felt lucky. Although there weren’t any chocolate brownies to finish (which was a disappointment), there was a fruit platter followed by a round of coffees.

After lunch, I felt I needed to learn more. I sat next to a chap called Martin who was pulling together different software components so he could do some data visualisation and to help with the ‘pricing of options’. Martin explained that an option is a right to buy an ‘instrument’. I was then told that an ‘instrument’ could be equities (or, company shares, as I know them). I was soon very lost. Martin was talking about volatility, intrinsic values and strike prices. He wanted to use Python to create a three dimensional graph which had three axes: time, volatility and moneyness. The idea was that graphs show up anomalies and help traders to understand what is going on in a market. I was thoroughly baffled. There was a huge amount of detail that I didn’t know about and wasn’t able to grasp.

After my eyes had glazed over, and had supped my way through another cup of free coffee, I had a chat with Stefan who ran the group. Stefan was originally from Germany and had flown in especially for the event. He worked as a consultant, offering training and advice to financial institutions. His event (and group) was all about sharing expertise, networking and making contacts.  He had started the group around eight months earlier and over four hundred Python and Quant people who had registered. He had hosted over ten events. Some events had been training sessions that you would pay for, other events were ‘hack days’ like this one. He even ran an event that was centred around Python and beer.

As we talked, Stefan showed me some of the mathematical features of Python; clever bits of the language that let programmers to ask the computer to solve and simplify equations. I had never seen a freely available programming language do this kind of thing before. This connected with something that I had picked up on: that Python was colonising a space in the software landscape that was once occupied by commercial companies. It was a computing tool that had a fan base, and this group was a reflection of the enthusiasm that some people had about the language.

For a couple of hours, everyone worked on their different projects. Stefan moved between different people, offering advice and commenting on their evolving projects. In some ways, the event wasn’t too dissimilar from one of the programming laboratories that I used to go to when I was an undergrad.

The main thing that I got from this event (other than the great sandwiches) was the knowledge that I didn’t want to work as a quant. Python looked kind of cool, and was pretty interesting, but I ended up being more confused about how financial markets worked than I started.

No comments:

Post a Comment