As Freetrade grew in headcount and increased its international presence, we decided to form a new Payments team in Sweden. Check out my new article on our journey around building out the Payments Platform.
Author: Patrick Buhagiar
First article for Freetrade
Checkout my article on how we do on-call at Freetrade!
The Impact of Macroeconomic Parameters and Global Markets on Forecasting the FTSE Index (Part 3)
This is the final part of my series of articles on my dissertation from the University of York. The first article introduced the basic concepts for this study while the second article described the experimentation process and approaches taken. This final article explains the results and evaluation.
Results and Evaluation
The Base Cases
The first base case consisted of just predicting the most common direction, while the second base consisted of a feedforward network which took the closing prices of the FTSE for the last five days.
The data used for training and testing these experiments spanned from 1st January 2013 to 1st January 2018. This translates to 1256 days of closing prices, thus splitting the data 80 / 20 will result in 1004 daily closing prices for training and 252 for testing. The direction of the FTSE index in the testing dataset rose 51.98% of the time, therefore 48.02%. Therefore, the predictive accuracy of the first base case is 51.98%.
As for all feedforward networks, an exercise for finding the most suitable learning rate and number of hidden nodes had to be performed. This consisted of running models with different combinations of parameters. For each combination, the model was run 20 times and the average accuracy was reported. The graph below shows the results from this exercise for the second base case.
The optimal parameters for the second base case were 9 hidden nodes with a learning rate of 0.0016. These parameters achieved an average of 55.36%. Continue reading “The Impact of Macroeconomic Parameters and Global Markets on Forecasting the FTSE Index (Part 3)”
The Impact of Macroeconomic Parameters and Global Markets on Forecasting the FTSE Index (Part 2)
This is part two of my series of articles on my dissertation from the University of York. While the first article introduced the basic concepts required for this study, the second article describes the experimentation process and approaches taken. Check out my GitHub if you want to skip to looking at the code.
Objectives
This study seeks to measure the impact of certain external factors when predicting the direction of the FTSE index. These external factors are macroeconomic parameters and closing prices from other stock market indices. It is important to highlight that this study does not predict the actual closing price, but only whether the index will rise or fall on a daily basis. The aim of this study was not to find a state-of-the-art technique, or to build a trading tool, but rather to only study the impact of data. Therefore, predicting the direction was deemed enough for measuring this impact. Additionally, I only had four months, so I also had to limit the scope of my study somehow!
Experiments
The study consisted of the following experiments:
- Predict the FTSE index by incorporating FTSE data with closing prices from other stock market indices. (Hypothesis 1)
- Predict the FTSE index by incorporating FTSE data with macroeconomic parameters. (Hypothesis 2)
- Predict the FTSE index by incorporating FTSE data with both closing prices from other stock market indices and macroeconomic parameters. (Hypothesis 3)
To determine whether an improvement in prediction accuracy was achieved, the above experiments were compared with two base cases:
- Always predict the most common direction. (Base Case 1)
- In the chosen dataset period (1st January 2013 to 1st January 2018), the most frequent direction was up.
- Predict the FTSE index by using the FTSE data only. (Base Case 2)
For all three hypotheses, the null hypothesis was that the method in question makes no significant difference in prediction accuracy when compared to underlying base cases.
The Impact of Macroeconomic Parameters and Global Markets on Forecasting the FTSE Index (Part 1)
The following series of articles is about my masters dissertation from the University of York, supervised by Dimitar Kazakov. The project spanned over four months, therefore the project had a very limited scope. Nonetheless, the aim of this study was to measure the impact of macroeconomic parameters and closing prices from other global markets when predicting the direction of the FTSE index. This study made use of feed-forward networks and an ensemble approach with the TensorFlow library.
This article will serve as a basic introduction by defining some basic concepts, particularly stock markets, stock market indices, market contagion, macroeconomics and microeconomics. It will also mention what sort of data was used in this study. Feel free to skip this article if you are already well versed in these topics.
Background and Data
Stock Markets
A stock is basically a share of a company. These stocks can be traded on what is called a stock exchange. Companies that are traded on a stock exchange are referred to as a listed company. As of June 2017, the stock exchange with the highest market capitalisation was the New York Stock Exchange (NYSE) at $21 trillion. These stock exchanges do not operate 24 hours a day and are closed throughout the weekend and bank holidays. The following table shows the opening and closing times for different stock exchanges from around the world. The price of a share at the end of the day is referred to as the closing price.
Hack Cambridge 2018
This weekend I had the opportunity to attend yet another hackathon. This is my second MLH hackathon, with the previous one being Great Uni Hack 2017 in Manchester. Unlike at GUH however, I aimed to build something of value and challenge myself.
I was nervous at first, particularly because I was going alone and had no team. Fortunately, I met two other like-minded students and we immediately got along. Interestingly, we were all coming from different backgrounds and universities. One came from a computer engineering background, the other was more into high performance computing while I was coming from a service oriented/full stack development background. Nonetheless, we managed to work well as a team.
Great Uni Hack 2017, Manchester
This article won’t be like my previous articles, but rather a few notes about my experience at my first proper Hackathon. I’ve been to (and won) programming competitions before, such as Game of Codes and Google Hash Code, however those were pretty intense and stressful. This time however, we decided to simply have fun and learn something new.
I teamed up with two of my course mates from the University of York, Sophie and Tasman, and attended the Great Uni Hack 2017. Quite possibly, we came up with the wackiest idea in the whole competition.
There were many prizes and competitions to target in the hackathon, each one from a different sponsor. We decided to focus on American Express’s competition, which was to make an innovative travel companion app. Although we didn’t manage to win that prize, we did win the popularity prize.
Person Identification
There have been many implementations in recent years for identifying the human form within a given photo frame, however one particular method stands out called Histograms of Oriented Gradient (HOG) descriptors. Given a training set, the HOG algorithm is capable of eliminating information irrelevant to human detection. The human form can be shown in many different poses, perspective, ambient lighting and backgrounds, however one of the most important characteristics that is common to all are edges and corners. The edge and gradient structure information is defined locally in small regions. The HOG technique consists of counting occurrences of gradient directions in localized cells (or pixel matrices). We then normalize these local histograms. It is suggested that the human form can be represented by using the distribution of local intensity gradients.
For my MATLAB implementation, check out my Github.
Implementation
The person identification system can be divided into two main functions which are:
- TrainHOG – will compute the necessary weights from training data.
- PredictHOG – will use the previously mentioned weights for predicting whether input images are human or not.
Testing Techniques for a Betting Website
This assignment was part of the Fundamentals of Software Testing study unit, therefore the main aim of this assignment was to explore and try out different testing techniques and tools which include:
- Unit Testing
- Selenium (Automated Web Testing)
- Cucumber
- Model-Based Performance Testing
I’ve worked on this assignment with my good friend Jake Dalli. Check out my GitHub for our code!
Overview
The main idea of this website was that we were working for a new online betting company which allows users to place blind bets on sports events without them needing to know what sport or team their money will be bet on. The company employs expert betting analysts to place bets on behalf of users. In effect, a user can place a bet of (for example) EUR 5 and a betting analyst might split that into three different bets to spread the risk across different events. We are required to develop an initial version of the website using a 3-tier approach with the following requirements:
Monte Carlo Optimization: Exam Timetabling
The exam timetabling problem is a classic real life problem faced by all education institutions. When given a period of time, it is required to allocate all exams into specific timeslots without creating any collisions. There are many ways of implementing an exam timetabling algorithm, however one efficient way is to implement a Monte Carlo optimized Hyper-Heuristic algorithm. Hyper heuristics can be considered a type of nearest neighbour (or Greedy) algorithm with the only difference being that it seeks to automate the selecting process through machine learning.
Check out my GitHub for the implementation.
We are first required to define the necessary parameters and present them as a tuple in order to solve this algorithm. These are:
- E → The set of events
- I → The domain
- K → Constraints
E → Set of Events
In this case, the set of events are examinations. In the classic exam timetabling problem, for each exam we are required to define the set of all students which need to sit for the exam. Since this is a simple implementation, it is assumed that students in the same course do not have electives, therefore each student in the same course will sit for the same exam. In the programming implementation, each exam will list which courses are to sit for the exam.
A Course class and Exam class were created. The course class for this implementation contains the course name and number of students. The exam class on the other hand contains a list of courses that are to sit for the exam and the exam code.
Continue reading “Monte Carlo Optimization: Exam Timetabling”