Do you want to be a quant and predict the movement of stocks for your own profit? Well then you better have a worthy source of data!
Quant shops are nowadays relying on increasingly esoteric sources of information to compete with one-another in predicting trends in the financial markets. The term used here is the ‘alpha’ of a trading strategy— and alpha disappears quickly for data sources.
Bygone are the days when one could look at seasonal trends in stock prices or run pearson correlation coefficients between stocks to produce a trading margin. Graduate analysts have run ARIMA models and out-of-the-box sklearn models on every permutation of financial time-series. By now, hedge funds are paying millions to acquire any high-quality data source their competitors don’t have access to, like satellite data to track shipping and resource production.
Today we will take a look at a slightly less common information source (though one that most quants are already aware of): company insider stock trading activity.
By law, key public company insiders and shareholders in most jurisdications must disclose significant purchases and sales of their own shares to financial regulators. This is to avoid insider trading: leveraging non-public insider information to gain an edge over the wider market. In the US, such players must fill in Form 4 for the Securities and Exchange Comission. This information is widely available on various websites on the internet, and will be the basis of this article’s analysis.
So what could this information show us? It is unlikely to disclose actual illegal insider trading activity, but the hypothesis is that it will reflect how those key company players feel about the future prospects of their company’s stock price. That is: if they believe the stock will tank in the near future, they will be more likely to sell their stocks, and visa versa. I.e., a measure of insider near-term sentiment.
Insider Activity Scraping
To obtain this insider stock transaction information, simply search for ‘Insider Activity’ on a search engine and find a comprehensive website that lists many company stock market ticker symbols. For reasons of self interest, I won’t disclose the particular website I have used.
You can then use the python packages ‘requests’ and Beautiful Soup to scrape the HTML table with the insider transactions, and put them into a pandas dataframe. I then used the pandas DataFrame.to_csv() function to store the data as .csv files in a local drive.
For this article, I scraped around 7000 different public company insider trade sites by iterating over a pre-compiled list of company stock ticker symbols.
Stock Market Scraping
Next, you’ll need some public company stock price data. I used the exact method above to scrape Yahoo Finance historical stock price data for each of the 7000 publicly traded companies. This was similarly transformed into .csv files using pandas.
Next, for each company I calculated the mean performance of the company stock price over 90 days (roughly one financial quarter) following each insider purchase or sale of stock. For US stocks, I recommend only using the insider trades marked as:
- P — Open market or private purchase of securities
- S — Open market or private sale of securities
I then divided this mean by the price on the day of the transaction to produce unitless overall performance values:
= mean(stock price over 90 days)/(stock price on day 1)
To make the insider trades across different companies (with different market caps and stock prices + volumes) comparable, I divided the value of each insider transaction (number of shares * share price) by the total value of transactions in the open market on that same day (volume * closing price of the stock).
We hence now have the stock performance following each insider trade, along with a normalised value of the magnitude of each insider trade.
Finally, I transformed these insider trade magnitudes into percentiles across all companies examined (so they range from 0.0 to 1.0).
So here’s the results. As we can see, the Pearson R is relatively low (0.11), suggesting that there is not a strong correlation between insider transactions and 90 days performance. However, this might be substantially improved by subtracting out major stock price variance due to factors external to the company. The data is also largely unbalanced due to most transactions being quite minor. Further, the trend between public company insiders selling their own stock and it subsequently declining in value is larger than the converse. It hence seems that company insiders are better at predicting stock declines than stock appreciation (R = 0.13 when looking at insider stock sales). Finally as the data I parsed is from the year 2020, the recent coronavirus impact might drown out the value of insider information, as stock swings are currently highly correlated with major corona headlines.
So for what purposes would this type of insider data be useful? It might serve as a sort of ‘sanity check’ for medium-term investors for insider sentiment. Combined with other indicators — macro-economic indicators, technical indicators (e.g. MACD), recent news, and fundamental analysis (e.g. P/E ratio and value investing concepts)— it could be used to add a bit of intelligence to a standard dollar-cost averaging investing strategy.
You may enjoy our other stories:
Shorting the Short Sellers? Quarantine and Financial Madness
NOTE: This blog post does not promote investment advice. Speak to a financial advisor.
Can you Time Economic Downturns?
The market can stay irrational longer than you can stay solvent. ~ Keynes