65th SAMS Congress
06-08 December 2022
Stellenbosch University
SUN Logo

Algorithmic trading of securities – A machine learning approach
Philip van Schalkwyk\(^*\) and Stephan Nel
Stellenbosch Unit for Operations Research in Engineering,
Department of Industrial Engineering, Stellenbosch University

SAMS Subject Classification Number: 10, 25, 26

The incorporation of quantitative strategies into classical investment management has resulted in the ability to not only access data at unprecedented speeds, but also analyse vast amounts of data at significant scale and varying levels of abstraction. Aside from the unrivalled speed advantage, quantitative investing— especially those based on data-driven, machine learning approaches— holds the potential to recognise patterns in security pricing data automatically, without the pitfalls typically associated with humanistic approaches. Apophenia is described as the human tendency to infer patterns from (mostly random) data — akin to, for example, humans observing elephant-shaped clouds, traders are also susceptible to recognising supposed patterns within trading data.
Whilst the vast majority of quantitative research involves supervised machine learning approaches, this study, on the other hand, focuses on the application of unsupervised- and self-supervised learning methods in the context of algorithmic trading. The pursuit of identifying non-trivial hidden patterns within the data to better predict market movement is further convoluted by the vast amount of technical indicators available in the domain of trading. To aid in the selection of technical indicators as input features, auto-encoders (a subset of unsupervised machine learning) are investigated towards identifying a reduced set of features, representative of the security price being predicted.
Due to the rapid and significant advances in the field of computer vision, more specifically convolutional neural networks (CNNs), a focus is placed on the encoding of time-series data as images by means of Gramian Angular Fields (GAFs). The GAF images, i.e. arrays, are automatically labelled according to the price movement that follows the time-span over which the images were encoded, and is then utilised for predicting price movement.

The main research objectives pursued are: (1) To investigate the application of unsupervised, and self-supervised learning methods in the context of security markets, and (2) to develop an optimisation-based trading strategy that seeks to maximise profit whilst effectively managing portfolio risk.