A machine learning framework for security forecasting and trading

Date
2024-02
Journal Title
Journal ISSN
Volume Title
Publisher
Stellenbosch : Stellenbosch University
Abstract
ENGLISH ABSTRACT: Financial markets are often perceived as unpredictable, a sentiment reinforced by the Random Walk Hypothesis and the Efficient Market Hypothesis. These theories underscore the considerable challenges in achieving excess returns without incurring substantial risk. Despite the expertise of fund managers, consistently outperforming passive index funds over the long term remains an elusive goal. This underperformance is not solely a reflection of human limitations but is indicative of the complexities and inherent uncertainties in market dynamics. Algorithms, unencumbered by human pitfalls such as fatigue, cognitive biases, and greed, demonstrate the capability for rapid and objective analysis of security pricing data. Their adaptability enables dynamic responses to market fluctuations, including the implementation of stop-losses and the avoidance of margin calls – a level of agility challenging for human traders to match. While various methods exist for time-series analysis, recent significant advancements in computer vision, along with the exceptional pattern-recognition ability of convolutional neural networks, have rendered them a favored tool in algorithmic trading. Employing computer vision algorithms, however, necessitates the transformation of a time series into a graphical representation. In this thesis, a comprehensive framework is designed and developed for the algorithmic trading of securities, centering on the image-encoding of time-series data. The objectives of the framework are two-fold in nature: Firstly, to predict the direction of security price movements using a set of conventional time-series classification methods and a suite of image-based convolutional neural networks, which utilise various encoding methodologies, including Gramian angular fields and Markov transition fields. Secondly, to demonstrate the practical utility of the obtained classification by simulating a trading environment where the effects of various components central to a trading strategy, are analysed. An instantiation of this framework is first tested on a benchmark time-series classification data set. Following this, the framework is applied to a real-world case study encompassing a diverse range of stocks, demonstrating its practical utility. In this real-world application, the image-based convolutional neural network models exhibit enhanced classification effectiveness compared to standard methods on average.
AFRIKAANSE OPSOMMING: Finansi¨ele markte word dikwels as onvoorspelbaar beskou,’n sentiment wat ondersteun word deur die lukrake bewegings hipotese en doeltreffende mark hipotese. Hierdie teori¨e beklemtoon die merkwaardige uitdagings wat gepaard gaan met opbrengste genereeer sonder om aan beduidende vlakke van risiko blootgestel te word. Al is kenners hoe opgevoed of ervare, dit bly ’n onbereikbare doel om die obrengste van indeksfondse, oor die lang termyn, te klop. Die onvermo¨e om indeksfondse te klop, kan toegeskryf word aan die onderliggende kompleksiteite van finasi¨ele markte. Algoritmes, wat onbelemmerd is deur menslike tekortkominge soos moegheid, kognitiewe vooroordeel en hebsurg, demonstreer die vermo¨e om spoedig en objektief sekuriteit pryse te ontleed. Algoritmes se aanpasbaarheid maak dit moontlik om dinamies te reageer op onvoorspelbare mark toestande, en om meganismes soos keerverliese stiptelik uittevoer; asook om ten alle tye ’n minimum-balans te verseker. Die stelling is egter nie waar ten opsigte van finansi¨ele sekuriteit handelaars. Alhoewel daar verskeie metodes vir tydreeksanalise bestaan, was daar onlangs beduidende groei in die veld van rekenaarvisie, en “convolutional neural networks” blyk om oor uitsonderlike patroonherkenningsvaardighede te beskik. Daarom is “convolutional neural networks” een van die gunstelling metodes om te gebruik in tydreeksanalsie, met die oog op algoritmiese handel. Die gebruik van rekenaarvisie-algoritmes verg wel dat ’n tyd reeks omgeskakel word in ’n grafiese voorstelling. In hierdie tesis word ’n omvattende raamwerk ontwerp en ontwikkel vir die algoritmiese verhandeling van finansi¨ele sekuriteite, wat sentreer om die grafiese kodering van tydreeksdata. Die doelwitte van die raamwerk is tweeledig: Eerstens, om die rigting van sekuriteitsprysbewegings te voorspel deur gebruik te maak van ’n stel standaard tydreeksklassifikasiemetodes en ’n reeks “convolutional neural networks”, wat verskeie grafiese koderingstegnieke gebruik, insluitend Gramian-hoekvelde en Markov oorgangsvelde. ’n Instansiasie van hierdie raamwerk word eers op ’n maatstaf tydreeksklassifikasiedatastel getoets. Hierna word die raamwerk toegepas op ’n werklike gevallestudie wat ’n diverse reeks aandele insluit, wat die praktiese nut daarvan demonstreer. In hierdie werklike toepassing toon die beeldgebaseerde “convolutional neural networks” modelle gemiddeld verbeterde klassifikasieeffektiwiteit in vergelyking met standaardmetodes.
Description
Thesis (MEng)--Stellenbosch University, 2024.
Keywords
Citation