Summer Internship at Alpaca Forecast Lab
Profile
Name: Félix Kleinpeter
Term: June 1 — August 30, 2019
Introduction
I was able to discover and get to know Alpaca as a company by doing a summer internship with them. I’m an engineer and computer science undergraduate and am currently in my first year of Masters studying Artificial Intelligence. My objectives for this internship were to discover how AI can be applied in very concrete subjects such as capital markets and while doing so, discover a new country and culture.
I. Life at Alpaca Data Science Lab
(Work schedule)
Even for internships, Alpaca is able to provide a very good work structure, and the team is able to share work progress transparently. To start, we do daily scrum every morning following the rules of the Agile method, making sharing of development tasks and reviews very easy. Because of this open and transparent progress sharing and report, I’m never in a position where my work is stuck, because my team and supervisors are always updated on my progress. We also use a task management tool called JIRA, and with it, it was very easy to create and assign new tasks at any moment with other members of Alpaca.
Besides using software, I am able to communicate with any member of Alpaca using Slack or just speak to them freely whenever I’m struggling with any issue.
Weekly, we also hold sprint retrospectives to talk about any subjects at work, and life at the company, summarising pros and cons of whatever issues we are dealing with and to come to a solution as a team.
(Work environment)
Usually, it is difficult for interns to work on the company’s core product, because internships are short in duration, and the type of work is actually quite different to what I was doing at university. During my internship at alpaca, my main project was working on a backtesting platform called Backlight. My development environment was based on Docker images which gives access to Jupyter notebooks, running on Alpaca servers. For other time consuming computation tasks, I was able to access AWS EC2 instances. I opened pull requests on the Git repository for each of my working instance tasks and asked for a review when I was done with it.
II. Timeline tasks
The personal objectives of this internship was for me to explore and familiarise all the different tasks available at hand. Then, I was given the choice to pick the tasks I find most interesting to work on.
(Reviewing data versioning and management tool)
Alpaca is working with many different code versioning tools. Our team kept track of the data used for all experiments to ensure that the results were reproducible. I reviewed data management and versioning tools, and summarised the pros and cons of different tools to help the team find the appropriate tool for their use case.
(Reading documentation on machine and deep learning and finance)
Even though I am specialising in AI for my Masters, the subject area is so broad that I had to document and keep track of all algorithms used by Alpaca. On the other hand, since I possess very little knowledge in finance, it was also important for me to learn the basics. Team members were enthusiastic in teaching me and shared many books and articles for me to read.
(Reviewing anomaly detection for time series methods)
At Alpaca, some members thought about different ways to improve their forecasting signal. One of those leads was to explore how detecting anomalies on the market data could help us improve the model’s performance and for that purpose I studied a series of papers on how to detect anomalies in time series data.
Afterwards, I had a discussion with my team to discuss different projects I could be working on. We decided that I would be focusing on the backtesting tool, Backlight. I summarised my research and focused on multi asset portfolio evaluation using Alpaca signals.
III. Utilisation of Backlight for mixed asset portfolio evaluation
(Purposes and goals)
We used the Sharpe ratio to evaluate the profitability of a portfolio of assets. The ratio represents how profitable the portfolio is compared to a no risk placement, under a certain volatility of the market. Alpaca’s goal was to increase the Sharpe ratio, hence raising profitability, of a single asset portfolio, for example, based on the EUR/USD market, by using a multi asset portfolio by mixing the EUR/USD and USD/JPY portfolios.
(Steps)
We used the Backlight library, improved its performance and extended it to fit our special case. From the signals, we could compute the best trades following different strategies and positions, such as the amount of asset and price at each instant. By studying the different positions of each asset, we could create different portfolios based on the assets by splitting the percentage of the portfolio between each asset. These portfolios are called equally weighted portfolios.
(Results)
By mixing assets with each other, we were able to create portfolios with a better Sharpe ratios when compared to single asset portfolios. Although single assets portfolios were still relatively more profitable, equally weighted portfolio had less risk, so in this way, the Sharpe ratio was increased.
Unfortunately because of a Non-Disclosure Agreement, I cannot share anything regarding the results here, but here is a notebook on Google Collab which contains some of the Alpaca signal tools I used during my internship.
https://colab.research.google.com/github/AlpacaDB/backlight/blob/master/examples/example.ipynb
Conclusion
Sad to say, a three month internship was not enough to fully explore everything Alpaca works on. However, working on Backlight has granted me exposure to so many different topics, and it was a very useful technical skill to learn. Doing an internship at Alpaca is very good experience for anyone looking for a startup environment with good atmosphere, here you can work on a wide variety of subjects too.