Master's Thesis

Learning To Rank, Pairwise And Listwise for the Stock Market

Pedro Emanuel dos Santos Ramos — 2022

Key information

Authors:

Pedro Emanuel dos Santos Ramos (Pedro Emanuel dos Santos Ramos)

Supervisors:

Rui Fuentecilla Maia Ferreira Neves (Rui Fuentecilla Maia Ferreira Neves)

Published in

December 9, 2022

Abstract

This work seeks to compare two types of algorithms, combining technical and fundamental analysis, with the objective of maximizing profits in the stock market. However, instead of using algorithms that only invest in the short term, in this work it is intended to invest in stocks every 3 months. To do so, it is necessary to create a good stock ranking/classification system. For this, several Learning to Rank algorithms exist, and in this work two of its approaches are compared, the pairwise (XGBoost) and listwise (Listnet) one. While the first is simpler and has already achieved excellent results, the second has already achieved even better results in non-financial contexts. That said, both types of algorithms will be tested and compared, by using the XGBoost and Listnet algorithm, in order to acknowledge which one has the best performance. In addition, a method of ensembling the predictions of both algorithms is also tested. The S\&P500 index was used as a benchmark, achieving a 43.71\% in a volatile testing period, between 2019 and 2022. In the same period, the best Listnet run achieved a profit of 116.02\%, while XGBoost achieved 152.35\%. Best results aside, in 7 runs for each algorithm, Listnet could always beat the benchmark, while XGBoost failed to do so for 3 runs. The Listnet algorithm was the only one who also could achieve a better Sharpe and Sortino ratio than the benchmark, suggesting it can have a less riskier behaviour.

Publication details

Authors in the community:

Supervisors of this institution:

Fields of Science and Technology (FOS)

electrical-engineering-electronic-engineering-information-engineering - Electrical engineering, electronic engineering, information engineering

Publication language (ISO code)

eng - English

Rights type:

Embargo lifted

Date available:

September 23, 2023

Institution name

Instituto Superior Técnico