Artificial Intelligence to Influence Sentiment-Based Algorithmic Trading into Herding

Kumar Brahmbhatt
Analytics Vidhya
Published in
3 min readOct 19, 2019

Some Background…

Quantitative data published by news journalists, blogs, and other forms of media influence automated trading bots to take action based on sentiment analysis.

Sentiment Analysis, as defined by Wikipedia, refers to the use of natural language processing, text analysis, computational linguistics, and biometrics to systematically identify, extract, quantify, and study affective states and subjective information.

In other words, sentiment analysis can be used to quantitatively identify positive and negative impact from text. In this example, we are referring to the use of the quantitative impact from sentiment analysis for making trading decisions. For example, based on sentiment analysis, we may buy 100 Apple Inc. shares if the sentiment is positive or sell 100 if negative. Note that, the quantity of buy/sell may also be determined based on some assumptions.

Why you might care

Let’s say you read on Twitter that your friend Joe buys 100 Tesla stocks because he thinks Tesla is going to introduce a new product and the price of the share will increase, and you follow in his lead and buy shares of Tesla yourself. You and your friend Joe might think you can benefit from buying low and selling high. However, this behavior in economics and finance is called herding .

Herding is when individual investors react to information about the behavior of other investors rather than the behavior of the market and transactions.

Assuming data required for sentiment analysis uses some web scrapping methodology to search relative news, blogs, or other media on the internet, is it possible to trick algorithmic trading based on sentiment analysis by publishing artificial news, blog posts, or other media on the internet?

…is it possible to trick algorithmic trading based on sentiment analysis by publishing artificial news, blog posts, or other media on the internet?

How I discovered this

Ever since I learned about it since a college psychology class on learning and memory, I’ve been a big believer in the Breakout Principle. The idea, as I understand it, is simple — after a prolonged, continuous session of studying or working take a short break to enhance creativity, productivity, and other benefits.

I had been reading quite a lot about algorithmic trading. Specifically, one day I stumbled upon something that I was particularly interested in — this article discusses the use of Natural Language Processing (NLP) to develop a “sentiment-based market-neutral trading strategy which gives consistently favorable returns with low volatility over a long period.” Later that evening, during a conversation with a friend, he used an idiom to describe a situation and something just clicked for me. I easily connected the dots to the article I was reading earlier and thought why couldn’t NLP be used to trick other automated trading bots that are using NLP to scrape the web for sentiment analysis, then using the sentiment for marginal market gains.

By the way, the idiom my friend used was (in translation)…

Fight Fire with Fire.

— Anonymous

Next Steps?

In order to prove or disprove our hypothesis — artificial news can influence automated trading bots based on sentiment analysis — we would need the following approach:

  1. Build an NLP model that can extract quantity and quality of sentiment based on published article(s) from a website.
  2. Develop a trading bot that consumes information from the step above — our sentiment analysis model — to execute trading.
  3. Publish positive article on the same website from step 1.
  4. Record trading transaction from step 2.
  5. Repeat steps 3 and 4 with various combinations of positive and negative articles about selected investments.

Based on the steps above, if the positive articles lead to buy behavior and negative to sell, then we can prove our hypothesis is true. Note that, this approach assumes that there is only one trader in the market. Therefore, it does not conclude herding behavior, but rather concludes whether sentiment analysis from published articles will make intuitive trading decisions. If the prior hypothesis is true, influencing sentiment analysis can also be assumed to be true.

--

--

Kumar Brahmbhatt
Analytics Vidhya

A data scientist working to better understand how consumer activity motivates and shapes customer behavior.