Is it possible to create an algorithm for trading on the exchange by analyzing the sentiment of messages on the Internet

Published on April 25, 2016

Is it possible to create an algorithm for trading on the exchange by analyzing the sentiment of messages on the Internet



    In our blog on Habré we write a lot about algorithmic trading and creating algorithms for working in the financial markets. One of the most promising and popular areas of research is forecasting the situation on the stock market based on various information. For this, in particular, data on the tonality of messages published on the Internet (sentiment analysis) are also applied.

    Today we’ll talk about whether it is realistic to create any effective trading strategy using this method.

    Online Messaging and Stock Market


    Messages on social networks can have a serious impact on the situation in the stock market. There are widely discussed cases where some traders earn significant amounts literally with a single tweet . Sometimes it is even exploited by cybercriminals who, for example, create fake accounts of analytical companies by publishing messages in them that can increase or collapse the price of shares of a particular company.

    In turn, the developers of trading systems are starting to create algorithms that could generate recommendations about making a purchase or sale based on data available on the network. There are many varieties of such algorithms. Some of them involve measuring interest in the topic of finance, which may indicate imminent market movements - for this they can use, for example, the Google Trends service .

    In addition, systems are being developed that analyze the tone of published news or reviews of financial experts. Earlier in our blog, we wrote about an approach to forecasting stock market movements based on an analysis of publications in financial media. Its developers created an algorithm that assessed the authority of a particular expert, whose opinion was presented in the material and the accuracy of his past forecasts, and based on these data generated assumptions about how accurate the new forecast of the analyst would turn out to be.

    image

    In addition, many financial companies and hedge funds use special systems to assess the tonality of messages in social networks and communities to predict possible changes in the stock market. For example, back in 2010, The New York Times talked about Lexalytics tonality technology used by Thomson Reuters and Dow Jones.

    But what results can be achieved using such an analysis?

    Experiment: creating a trading strategy using tonality assessment


    Ronald Hochreiter, a professor at the University of Economics and Business at Vienna, has published a description of an experiment to create a trading strategy that uses message sentiment estimates on social networks and communities to create forecasts.

    According to Hochreiter, the data of discussions on the Internet can be useful from the point of view of “popular wisdom” - different people from different cities and even countries who defend various independent points of view participate in the discussions. Aggregation of such data, in theory, can allow the creation of models of behavior of bidders. This idea underlies investor sentiment tracking projects like StockTwits .

    Hochreiter decided based on StockTwits and PsychSygnalAssign stocks a potential growth (bullishness) or fall (bearishness) ratio. This rating was used by his system as a substitute for technical indicators for making purchase or sale decisions.

    During the experiment, Hochreiter used historical data on stock prices included in the Dow Jones Index from 2010 to the end of 2013. At the same time, to compare the results of the strategy, based on the analysis of the sentiment of messages on the network, a classical approach was used to form a portfolio of financial instruments based on an analysis of the standard deviation of the financial results of various stocks on historical data.

    The strategy, based on the analysis of message tonality, showed the best characteristics of the riskiness of operations, and when using it, a lower maximum drawdown of the portfolio was recorded. However, during his experiment, Hochreiter did not take into account the transaction costs that arise in the course of real trading - their presence can make a strategy successful at the time of real trading unprofitable during tests.

    Media or social networks


    In turn, representatives of the IT department from Stony Brook University in New York, Wenbin Zhang and Steven Skiena, in their work, analyzed the connection between the tone of messages in social networks and publications in media and real results of specific actions. To do this, they downloaded historical data on 3238 shares from 2005 to 2009. Here's what they managed to find out:

    Researchers found a connection between the number of publications and the number of discussions and the trading volume - the more popular the company turned out, the more transactions were made with its shares (although the strength of this connection depends on the business sector - airlines are extremely sensitive to media tonality, IT companies - to a lesser extent).

    The influence of social networks (for example, Twitter) has a more delayed effect compared to media reports - sometimes the result of extensive discussions on Twitter reflected on stock prices only on the next trading day or a day later, while publications in large media immediately promoted growth or falling quotes.

    Strategies based on the analysis of media data, blogs or social networks show the best results at short intervals - the market usually reacts to the news quite quickly, so a longer holding period does not give a trader anything.



    In addition, it makes no sense to choose a large number of stocks based on tonality analysis - the more instruments selected in this way in the portfolio, the lower its overall results:



    Conclusion


    Studies show that there is indeed a definite connection between the tone of messages on social networks, blogs and media publications and the state of affairs in the financial markets. Scientists manage to develop strategies that show good results on historical data.

    Elements of such strategies are already being used in practice by some financial companies and hedge funds. However, almost none of them rely on such tactics entirely.

    Fortune Edition Toldthe story of a London hedge fund that launched a new project a couple of years ago called the Twitter Fund. A special computer system read 100 million tweets per week and determined on their basis the situation with current economic trends. The idea was terrible - the fund warmed up for two years.