594 research outputs found

    Predicting stock returns by number of company mentions in tweets

    Get PDF
    This study attempts to establish whether return or magnitude of return can be predicted by how many tweets mention a company by either its name or stock symbol. The sample data consists of 365 million tweets of which 706,700 mention a S&P 500 company between June 1st, 2016 and June 30th, 2017. It was found that tweets which mention a company by its stock symbol while stock markets are open have a positive impact on its return between 0 to 1%. No evidence was found of number of tweets holding a predictive value of the magnitude of return

    Transformer-based deep learning model for stock return forecasting : Empirical evidence from US markets in 2012–2021

    Get PDF
    A growing number of studies in recent years have deployed various machine learning methods for financial time series analysis. The ability of machine learning methods to deal with complex and nonlinear data sets, as well as the increasing amount of available data and computational capacity, has pushed research further in this direction. While machine learning methods are nowadays widely used for forecasting financial time series, the results have been mixed. The rapid increase in machine learning research has also meant that new and more advanced models are being developed all the time. In many areas where machine learning methods are employed, designs based on the Transformer deep learning model often represent the state-of-the-art. However, the applications of the Transformer model for financial tasks are still in their infancy as only a few studies have been published on the matter. This study aims to investigate the feasibility of a Transformer-based deep learning model for stock return prediction. The feasibility is tested by predicting the daily directional movements of four different US stock indices on an out-of-sample period from the start of 2012 until the end of 2021. Only historical price data is utilized to predict the directional returns with two sets of explanatory variables. The model performance is tested against benchmarks and evaluated using various performance criteria such as prediction accuracy. Moreover, a trading strategy is carried out to reveal possible profitable attributes of the Transformer-based model. The reported classification accuracy over the whole empirical sample for the better Transformer model is 52.52% while LSTM, another deep learning model used as a benchmark, achieves an accuracy of 53.87%. However, the Transformer model manages to defeat all the benchmark models in every other performance metric. When the performances are tested using the trading strategy, the best Transformer model is able to generate an annualized return of 15.7% before transaction costs. The best performing benchmark, a simple buy-and-hold strategy, yields a return of 14.2%. The two tested Transformer models also have the highest Sharpe ratios out of the tested models at 1.063 and 1.061. Nevertheless, after transaction costs are taken into account, none of the tested models beat a simple buy-and-hold strategy in terms of profitability. Although the Transformer model was not able to perform superiorly throughout the sample period, it nevertheless exhibited increased predictive performance over shorter periods. For example, the model seemed to exploit periods of higher volatility as seen during the start of the COVID-19 pandemic. Overall, although the predictive performance of the Transformer model in this study might leave more to be desired, the model undoubtedly has predictive properties which should encourage further research to be executed.Viime vuosina lisääntynyt määrä tutkimuksia on soveltanut koneoppimismenetelmiä rahoituksen aikasarja-analyyseissä. Koneoppimismenetelmien kyky käsitellä monimutkaisia ja epälineaarisia data-aineistoja, sekä lisääntynyt datan määrä ja laskentakapasiteetti ovat entisestään vauhdittaneet tutkimusta tällä alueella. Vaikka koneoppimismenetelmiä käytetään nykyisin laajalti rahoituksen aikasarjojen ennustamiseen, ovat niiden tuottamat tulokset olleet vaihtelevia. Koneoppimistutkimuksen nopea kasvu on myös tarkoittanut, että uusia ja kehittyneempiä malleja kehitetään kaiken aikaa. Monilla aloilla, joissa koneoppimista käytetään, alan johtavat mallit pohjautuvat usein Transformer-syväoppimismalliin. Transformer-pohjaisten mallien soveltaminen rahoituksen tehtäviin on kuitenkin vielä varhaisessa vaiheessa, sillä alalla on julkaistu vain muutamia tutkimuksia aiheesta. Tämä tutkielma pyrkii selvittämään Transformer-pohjaisen mallin soveltuvuutta osaketuottojen ennustamiseen. Soveltuvuutta testataan ennustamalla neljän eri yhdysvaltalaisen osakeindeksin päivittäisiä suunnanmuutoksia vuoden 2012 alusta vuoden 2021 loppuun. Tuottojen suunnan ennustamisessa hyödynnetään vain historiallista hintadataa kahdella joukolla muuttujia. Mallin suorituskykyä testataan ja verrataan muihin käytettyihin malleihin monin eri suorituskykymittarein, kuten esimerkiksi ennustustarkkuuden avulla. Lisäksi toteutetaan kaupankäyntistrategia, jotta nähtäisiin mallin tuottamien ennusteiden mahdollinen taloudellinen hyöty. Raportoitu ennustetarkkuus koko tutkimusotoksen ajalta oli paremmalla Transformer-mallilla 52,52%, kun sen sijaan vertailumallina käytetty LSTM-syväoppimismalli saavutti 53,87%:n ennustetarkkuuden. Kyseinen Transformer-malli onnistui kuitenkin suoriutumaan paremmin kuin vertailumallit kaikkien muiden suoritusmittareiden osalla. Kun mallien suoriutumista vertaillaan kaupankäyntistrategialla, paras Transformer-malli saavuttaa 15,7%:n vuosittaisen tuoton ennen kaupankäyntikustannuksia. Paras vertailukohta, yksinkertainen osta-ja-pidä-strategia tuottaa 14,2%:n tuoton. Kahdella testatulla Transformer-mallilla on myös korkeimmat Sharpen luvut: 1,063 ja 1,061. Kuitenkin, kun kaupankäyntikulut huomioidaan, yksikään testatuista malleista ei suoriudu osta-ja-pidä-strategiaa paremmin tuottojen osalta. Vaikka Transformer-malli ei pystynyt suoriutumaan selvästi parhaiten läpi koko tutkimusotoksen, se esitti kasvanutta suorituskykyä lyhempinä aikoina. Malli näytti pystyvän esimerkiksi hyödyntämään korkean volatiliteetin ajanjaksoja, kuten COVID-19-pandemian alkuaikaa. Kaiken kaikkiaan, vaikka Transformer-mallin ennustuskyky tässä tutkielmassa saattaa jättää toivomisen varaa, Transformer-malli on epäilemättä kykeneväinen ennustustehtävissä, minkä tulisi edistää lisätutkimusten tekemistä aiheesta
    corecore