Humans have always tried to predict the unpredicted, we strive to find out the unknowns and erase the odds. This is something that is part of our human nature. One system that man has tried to conquer and predict is the stock market. The stock market is the one of the most vital parts of the free market economy. Everyday over billions of dollar’s worth of stock, options, and currency trades hands from investors all over the world. Investors are trading daily trade over 1.6 billion shares, of over 2,200 stocks that are listed on the various exchanges. However, this market is quite unpredictable and reckless and can be compared to the proverbial “bull in a china shop.” That is where predictive analytics comes in to the equation. By using natural language processing (NLP)[1], machine learning[2], parallel computing[3], speech recognition and processing[4], sentiment analysis[5], and big data analytics it is possible for one to determine how news and people’s perception of a stock can cause the stock price to be volatile after all it is humans who program the trading algorithms and humans who are trading the stocks. So, what if we were able to tap into the minds of the people trading on the market to better predict the market and beat the odds.
This works if we follow this theory for market behavior: that the consumer’s confidence in either a company, the economy, and current global affairs, and their feelings or sentiments will either raise or lower the stock price. This works if we believe that the efficient market hypothesis holds true. The Efficient Market Hypothesis is a investment theory which states that the price of an asset reflects all the information that is available thus it would be impossible to generate returns and beat the market since the price at which the asset is trading at is the fair market value based on all the information that is available. This means the only time we would see an assets price swing drastically in the price is when new information enters the market at which point traders will trade on the new information which will move the price until the current market price reflect the new information available and at that point the information is no longer relevant.
But that assumes that everyone who is a player in the market perceives the market information in the same way and that everyone is playing fairly since the only way to beat the market would be with insider information or to invest in high risk investments with high volatility. In theory the Efficient Market Hypothesis makes sense but in practice is where the flaws in the hypothesis start to form given that markets as we know it are neither efficient or inefficient which is demonstrated by the trades able to take advantage of market situations to yield returns. This has to do with external factors affecting the market such as trade execution time, human error, human interference and unpredictable events.
Since humans are a major factor in markets their perception of the information is critical in making an informed decision in whether they should buy or sell an asset. This perception is called sentiment. Sentiment is the connotation that is associated with a word. This means that the word either has a positive feeling or a negative feeling. Sentiment analysis is the process of using computers to detect the polarity of text. The polarity of the text determines if the text is negative positive or neutral. This is also known as opinion mining where text is used to derive an opinion from text to draw statistical conclusions. This is very similar to how the human brain works when reading a news article and determining if the news is positive news or negative news. So if enough people believe the news is positive or negative that will thus in turn cause the asset to either rise in value or decrease in value since in my opinion, this has to do with the fact that most people don’t buy an asset because of what the company makes or its financial reports but they buy it because of the name and the feeling that they associate with that company.
But in order to move a market the news must be relevant so the news must either be about a specific company or news that has economic policy relation since markets are looking for expansion. The news also has to be digested and has to be acted upon in a timely fashion because of the efficient market hypothesis which is why certain safeguards have been put into effect by the United States Securities and Exchange Commission (SEC). One of these safeguards is SEC Regulation FD. Regulation FD is the Fair Disclosure act which states:“The Securities and Exchange Commission is adopting new rules to address three issues: the selective disclosure by issuers of material nonpublic information; when insider trading liability arises in connection with a trader’s “use” or “knowing possession” of material nonpublic information; and when the breach of a family or other non-business relationship may give rise to liability under the misappropriation theory of insider trading. The rules are designed to promote the full and fair disclosure of information by issuers, and to clarify and enhance existing prohibitions against insider trading.”(SEC Regulation FD)
The way that this regulation helps protect the market is that it prevents a firm from releasing market moving news without stop of trading so news can be digested and not sudden spike or drop in price. That is why most news regarding firms comes out when market close though this is not always the case. One example is when CEO of Tesla Elon Musk tweeted “Am considering taking Tesla private at $420. Funding secured. Shareholders could either to sell at 420 or hold shares & go private.” This was something that went against the Fair disclosure act since companies don’t normally announce plans to go private over twitter instead, they file forms with the SEC which is usually then released at the end of trading day.
What resulted was Tesla’s price skyrocketed minutes after that tweet and the trading frenzy that occurred caused the Stock exchange operator NASDAQ where Tesla is listed to halt trading of the stock until investors were able to get the relevant information through the correct channels and for the trading frenzy to die down. When trading resumed the following day, the stock was trading at a fifty-two week record low which was directly from Elon Musk tweet but also because market took into account SEC cracking down on Elon Musk for violating the fair disclosure act which lead to massive fines and his removal of being the CEO of Tesla.
So, while corporate news can affect a stock’s price the biggest influence in a stock markets movement is economic policy. Economic policy is policies which affect tax, trade or regulatory policies. These policies shape the global market and have a direct impact on the companies ability to generate profit and be competitive in a global market. This is because the goal of economic policy is to stimulate economic growth meaning that that the incomes of all market players both the consumer and the supply are increasing over time after accounting for inflation. This is accomplished by either increasing or decreasing certain regulations regarding industries, by raising or lowering taxes, or by implementing new trade policies to give American firms a competitive advantage in the global markets. The second goal is to provide price stability to the market preventing inflation and deflation. Inflation is when the value of a currency decreases its buying power and deflation is when the value of a currency increases its buying power. This buying power in the world market for the currency is compared to a market benchmark which is the ten-year US Treasury Bill so by controlling the interest rates the government is able to manipulate the buying power of the currency. The third and final goal of economic policy is to ensure full employment which means that every member of society that wants to work and is able to work is able to find work. This is critical because when people work it increases the growth in the economy and all the goods and services are being utilized meaning money is being utilized efficiently.
What this means is that changes in a stock price is directly correlated to the markets perception of whether or not the company or market will gain or lose capital from changes in economic policy and can offer insight to the markets expectation that the policies will in fact be implemented and are not just party rhetoric; because as an investor you have to be looking to the future, the change in the company’s stock will happen at the time there is news about a new policy or a change in the expectations that a policy will be implemented, which could be well before the policy is actually implemented instead of at the time the policy is implemented since by the time it is implemented the market price would have already adjusted to the news of the policy change and the policy change itself is no longer relevant.
Where this collection of policy related news changed was when President Donald J Trump took the office of president becoming America’s 45th president on January 21st, 2017. President Trump a self-proclaimed Washington outsider isn’t your typical career politician in fact during his first week of office he signed six executive orders which covered topics such as border security, healthcare, trade, financial markets, and government regulations. But it wasn’t his use of executive orders to push issues through congress that makes him different. For President Trump it is the way that he gets information out to the general public and that is through twitter. In fact, since entering office President Trump has tweeted out almost 11,000 tweets and almost 17,000 tweets when you include retweets. These tweets range from anything such as self-promotion to current events such as the trade war to attacks on his critics. One might be wondering why the President tweets so much and according to Ms. Conway who is on the President’s council “Twitter, is the president’s most potent weapon when it comes to bypassing the powerful people, he believes have controlled the flow of information too long. It’s the democratization of information. Everyone receives Mr. Trump’s tweets at once — the stay-at-home mom, the plumber working on the sink, the billionaire executive, the White House correspondent. They all hear ping, at the same time.” (NY Times)
So, while President Trump isn’t tweeting about companies, he is tweeting economic policies and things that can affect the economy like the trade war, impeachment, and fed rates. And since the stock market performance is directly correlated to Economic policy changes if we filter his tweets for ones that mention economic policies, we can start to predict market changes. If his tweet mentions a policy that would grow the market and expand the economy those would have positive sentiment. For negative sentiment you would look for tweets that affect economic policy negative like trade war tariffs and increase in interest rates. So, in analyzing his tweets if the tweet has negative sentiment then the market should react negatively and if it has positive sentiment the market should react positively.
Context of the tweets in not the only thing that we need to look at and that is the volume of the tweets since on days with more tweets we would expect the volatility of the asset to stay high and on days with low tweet volume the volatility would be low since there is not a lot of new news entering the market. So, once they are sorted and tagged we can see how they affect the market since markets only respond to extremes such as very positive news or extremely negative news and that due to the fundamental market theories since the market is constantly adjusting to new market variables so that there will not be any real significant data from any neutral news. Since changes in price and volume are directly correlated to new information entering the market, we can expect that when there is an increase of extremely positive or extremely negative information entering the market the change in volatility would corresponding to the amount and sentiment of the news.
Volatility is the amount of uncertainty or risk in the size of changes in a security’s value. If the price stays relatively stable, the security has low volatility. If the price moves erratically, and experiences rapid increases and falls, the security has high volatility. The higher the volatility, the riskier the investment. When risk is increased the potential ROI is at its highest value which falls in line with the principles of the efficient market hypothesis that the only way to increase the return on investment is to invest in riskier investments. Volatility is calculated using two different methods. The first method is called historical volatility and is performed by doing statistical calculations on the historical prices over a specific time period. The statistical calculations that are used are the mean, variance and standard deviation on the historical price. The end value of standard deviation is a measure of risk or volatility and since that is the risk that is built into the securities price one would expect that if no new news enters the market that the volatility of the stock will not change over different time periods. The formula for Calculating Historical Volatility can be seen in Figure 1 below.
Figure 1: Formula to Calculate Historical Volatility
The second measure of volatility is called Implied Volatility which takes the present and future sentiment of the security or Index called the option price to calculate the future volatility. Options are a type of financial security and are directly correlated to a stock or an index. The Options price is determined by the probability of a particular stock’s current price moving enough to reach a particular level in a certain time frame i.e. the probability of the volatility being a certain percent. This measure of volatility would directly correlate to price changes since this is a predictor of what the stock will do in the future. The formula to calculate Implied Volatility can be seen in Figure 2 below.
Figure 2: Formula to calculate Implied Volatility
These price changes can only happen if people are buying and selling the stock. This action of buying and selling is measured as volume. Volume is the number of shares traded in a certain time frame. When a stock sees an increase in trade volume it means that more people are buying and selling the stock and that those people are agreeing on a fair price to sell and to buy the stock given the information available to them. Thus, an increase in volume can usually be directly correlated to a change in price. Though this is not always the case since another factor to take into account is the liquidity of the asset.
Liquidity is how fast a stock can be bought or sold in a market at the fair market price. If a stock can be bought and sold quickly that means the price is a fair price and there is constant interest in the stock and demand for the stock can be met. If a stock has high liquidity a high volume will not be an indicator of price swings since the spread between what the buyer is offering and what the seller is asking is very small and the volume will not affect the price, but when the spread between what the buyer is offering and what the seller is asking is huge volume can be used for a predictor of change in price. Given that markets are neither efficient or inefficient it is when there is changes in liquidity that volatility can be used to calculate market changes.
Since we are looking at indexes for this project the implied volatility is given to us by the CBOE VIX which is the Chicago Board of Options Exchange Volatility Index. The VIX is a market index that represents the market sentiment and outlook for the next 30 days based on the price of the S&P 500 index and the 500 stocks that compose of the S&P 500. The VIX is calculated using the formula seen below in figure 3. The VIX gives us the Implied Volatility for the S&P 500 and can be used as a fear gauge for the market and a general sense of market stability.
Figure 3: Formula to Calculate CBOE VIX
Though volatility does not predict which direct the swing will go only meaning will the price increase or decrease but instead only tells you how big of a swing to expect in the price. So, by using sentiment analysis of new information entering the market we can predict if a swing in price is going to happen, the size of the swing in price, and the direction of the price meaning will it go up, go down, or remain unchanged.
Footnotes:
[1]The ability for computer to derive meaning from natural language input
[2] Algorithms that can learn and adapt from past data
[3] Helps in performing large computations by dividing the workload between more than one processor, all of which work through the computation at the same time.
[4] The ability for computer to derive meaning from natural language input
[5] Deriving the connotation of a word detecting if it is negative or if it is positive and assigning a numeric value to the words.