Inspired by the book<The market (Mis)behavior of Markets> which adopts a new theory — fractal geometry — to explain the financial markets and how things work in nature visually and mathematically. Here I just want to share my thoughts with you regarding th...
As we all know that Microsoft has agreed to buy Linkedin for $26.2 Billion on June 13th earlier this month. I thought it would be perfect timing to conduct an event study on Merger and Acquisitions (M&A) and its impact on the stock market.
Also, in order to develop effective trading strategy and algorithm, we need to make sure our model is able to incorporate new market event information effectively and this requires us to extract key asset-specific factors such as the prices trends, liquidity, volatility through the event study before building the strategy. Furthermore, by analyzing the market in general we can also gather the information and find about the proper order size and trade horizon for our strategy. Then combined with investors’ requirements like the benchmark, risk aversion and trading goals we can finalize our algorithm to effectively deliver those requirements.
First, let’s look at the trend graph of the M&As for recent 20 years:
As algorithmic trading becomes increasingly popular, the next question would be, how are risks that are associated with algorithmic trading monitored and controlled? By co-locating the servers with market servers at an exchange or “dark pool” data center, algorithmic traders increase the speed they can get to access the markets. Regardless, I would like to discuss certain types of common risks associated with algorithmic trading and the potential measures to mitigate those risks within algorithmic trading.
Let’s widen the scope and look at two key risks that are commonly related to algorithmic trading and the reasons why it is so important to build strategy that focuses on controlling the risk of trading algorithmically:
As algorithmic trading becomes increasingly popular, the next question would be, how are risks that are associated with algorithmic trading monitored and controlled? By co-locating the servers with market servers at an exchange or “dark pool” data center, algorithmic traders increase the speed they can get to access the markets. Regardless, I would like to discuss certain types of common risks associated with algorithmic trading and the potential measures to mitigate those risks within algorithmic trading.
Let’s widen the scope and look at two key risks that are commonly related to algorithmic trading and the reasons why it is so important to build strategy that focuses on controlling the risk of trading algorithmically:
As I mentioned in my last article, I will complete this sentiment study and share more interesting findings here with you. Based on the financial event study that I posted before and other research in the financial domain, there is increasing evidence that online sentiment can help predict subsequent market activity. But its effect, news to trade prices, is asymmetric, news with positive sentiment has been demonstrated to relate to a large price increase for a relatively short period of time; and negative sentiment, however, is linked to price decrease but with more prolonged effects. The next question would be how can we use sentiment to help us to make a prediction about stock prices? Based on the study of this topic, here is the summary of my study:
Based on the sentiment trading algorithm I posted in my last article I would like to display the adjustments that I made on this strategy and the live trading result of this strategy.
The graph below shows the backtesting result of the algo that I modified based on the original post. This time, I take the potential influence of the earning surprises (one of the most common financial events which occur when a company’s reported earnings above or below analyst’s expectations)into account. Though I did not quantify the influence into the algorithm yet( I will show you the example of how to take advantage of earnings drift in my article in the future), I have simply added the filter to my strategy to narrow down the securities whose companies are about to report the earning announcement soon or who just published their earning announcements in order to mitigate the potential risk and volatility of my strategy.
As I asserted in my last article, we can find that the sentiment analysis trend has been on the rise since 2008 (Google Trends). In order to further verify this trend and its relationship with the stock market, I did the following test using Google Correlate(you can feed in your keywords or topics, and it will tell you which search terms are most closely correlated with your data). I intended to test the factors contributed to the ‘stock returns’. From the list of correlated words with ‘stock returns,’ we can see that the ‘opinions’ rank the highest and their correlation coefficient is about 0.91(this list is generated based on the weekly trend of each word over time). The following graph is the linear regression plot between the two words and the graph shows a clear linear relationship between the two words.
With the advance of computer natural language processing and understanding capability, we can add and deploy more factors and add them into our prediction model such as the news sentiment score that I will introduce here.First of all, I would like to introduce a little about the background of sentiment analysis based on my research. Nowadays, it is accessible for us to take advantage of the advanced technology to analyze the textual information contained in the news items and assign the a ‘sentiment score’ to each article that may bring an impact on the stock’s price and an aggregation of these sentiment scores from multiple news or posts from certain timeframe was found to be predictive of stock’s future returns.According to Google Trends, the word ‘sentiment analysis’(refers to the use ofnatural language processing(NLP),text analysis, and computational linguistics to identify and extract subjective information in source materials.) has been increasing dramatically over the past 5 years, as you can see from the graph below:
I have posted some pictures and tables about how to evaluate algorithm’s performance and the risk characteristics in my last article. In this article, I will go through each picture and explain a little bit more about them. Also, I will perform more tests on my portfolio related to this topic. Hopefully, these tests and explanation can provide you with a comprehensive insight about evaluating and understanding an algorithm.
It is helpful for us to run through the backtest over a long time period since we can only get access to the exhaust data. Here is the updated backtesting result of my strategy (posted in my last article)which is from 2010–12–31 to 2015–12–31(5 years in total).
You can see that the returns are moving upward in general over last five years. From the metrics, we can see that the total returns are almost twice as large as benchmark’s returns. The alpha is 0.31 and the beta is -0.33 which means the strategy actually is kind of moving towards the opposite direction of the market over time. The Sharpe ratio is high enough to prove the test is significant to some...
The factor models I used before are mostly fundamental factors which may not be very handy when we would like to add more elements into our model. Here I will explain an algorithm which uses Multi-Factor model to resolve this problem simply. Now, we can actually define our own customized factors and use them as filters or ranking system to allocate stocks into either long or short basket as well as to narrow down the stocks included in your universe.
The ‘CustomFactors’ that I used here are calculated using pricing, volume, and fundamentals data. By utilizing this method, we allow ourselves to have more freedom to choose whatever factors we want to add into our model so that we can define the inputs and the looking back window length based upon our intuition or research when we are creating the factors and then set them as default for the next step.
The 3 customized factors I defined here are: