EconPapers    
Economics at your fingertips  
 

Trading on online social mood: A machine learning strategy based on Twitter sentiment

Chengying He, Mason Lin and Ning Wang
Additional contact information
Chengying He: Sino-UK Blockchain Industry Research Institute, Guangxi University, Nanning, P. R. China
Mason Lin: Davidson College Davidson, NC 28035, USA
Ning Wang: Oxford Nie Financial Big Data Laboratory, Mathematical Institute, University of Oxford, Oxford, UK

International Journal of Financial Engineering (IJFE), 2021, vol. 08, issue 04, 1-16

Abstract: This paper examines the potential of using online social sentiment data in algorithmic trading strategies. Several machine learning models are tested to produce a trading signal from the sentiment data to forecast the trend of a stock’s price. The algorithms are trained on the features extracted from PsychSignal data (containing bullish and bearish sentiment from Twitter). One most popular model, Random Forest (RF) classifier, is selected to generate a signal for the trading strategy. After backtesting on 1386 stocks listed in both NYSE and NASDAQ, the results show that the proposed model outperforms the baseline model, a simple moving average (SMA) strategy. We use the GridSearchCV to fine-tune the parameters of the classifier and compare the performance with the SMA baseline and the SPY benchmark, showing that our model generates 114.5% return on investment from January 2013 through October 2015. Additionally, the portfolios constructed by the RF classifier appear to produce a higher return than portfolios constructed by an SMA strategy. The results show that Twitter sentiment data is a valuable technical trading indicator for specific sectors.

Keywords: Machine learning; online sentiment; social media (search for similar items in EconPapers)
Date: 2021
References: Add references at CitEc
Citations:

Downloads: (external link)
http://www.worldscientific.com/doi/abs/10.1142/S2424786321410115
Access to full text is restricted to subscribers

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:wsi:ijfexx:v:08:y:2021:i:04:n:s2424786321410115

Ordering information: This journal article can be ordered from

DOI: 10.1142/S2424786321410115

Access Statistics for this article

International Journal of Financial Engineering (IJFE) is currently edited by George Yuan

More articles in International Journal of Financial Engineering (IJFE) from World Scientific Publishing Co. Pte. Ltd.
Bibliographic data for series maintained by Tai Tone Lim ().

 
Page updated 2025-03-20
Handle: RePEc:wsi:ijfexx:v:08:y:2021:i:04:n:s2424786321410115