“Stock Market Anomalies” and “Stock Market Anomaly Detection” Are Two Different Things
By: Dr. Dataman
Tags: Stock Market, Anomaly Detection, Machine Learning, Investing, Data Science

(B) What Is Stock Market Anomaly Detection?

Anomaly detection has been widely studied in statistics and machine learning, where it is also known as outlier detection, deviation detection, or novelty detection. The burgeon of various successful outlier detection algorithms is now applied to detect outliers in the stock market prices.

A direct application of outlier detection is to detect any market manipulation. Market manipulation is a deliberate attempt to intervene in the market price in order to create artificial, false, or misleading appearances with respect to the price of a security. Market manipulation is detrimental because it distorts the prices and undermines the function of the security market. What’s more, many investors would lose significantly because of most manipulators’ illegal profit-making. Allen and Gale (1992) and Jarrow (1992) were the first researchers to study manipulation. Allen and Gale classified the manipulation as action-based manipulation, information-based manipulation, and trade-based manipulation. The focus here is the trade-based manipulation, which Allen and Gale defined as distorting stock market prices through actual trading orders. In order to do so, daily stock data or intra-day data such as tick data are collected. Detecting any illegal insider trading is another application. Anyone who possesses inside news before it becomes public can trade on this advantage. In most cases, illegal insider tradings are detected after the news becomes public for a while. It is often too late: fraud has been committed and innocent investors have been disadvantaged. We need a timely response or an early warning detection system. Machine learning, therefore, comes to play a promising role.

I think you get the idea for the difference between “stock market anomalies” and “stock market anomaly detection: the former concerns the Efficiency Market Hypothesis (EMH), and the motive of the latter is primarily driven by machine learning innovations.

What are the typical corporate events that insider tradings take place?

Merger & Acquisition (M&A) and earnings announcements are the typical corporate events that insider tradings take place. Ahern (2017), by using all the insider trading cases filed by the Securities and Exchange Commission (SEC) and the Department of Justice (DOJ) between 2009 and 2013, reported that M&As account for approximately 51% of the insider tradings, followed by earnings announcements, 26%. The remaining events include clinical trial and regulatory announcements, sale of new securities, and operational news, such as CEO turnovers.

What are the symptoms of a typical insider trading?

When people trade on inside information, they leave traces of this in trading data. Donoho (2004) documented some known symptoms:

Abnormally-high trading volumes

Unusual price movements

Less traded (or “thinly traded”) securities

Options as the cost-efficient channel. Options can amplify an insider’s gain if he or she is very certain about the inside information. For example, if a person knows XXX company will be acquired in the next few weeks and the stock is likely to jump from $50 to $60. If the insider buys XXX stocks at $50, he or she makes a 20% profit when it jumps to $60. However, if the person buys a call (with a strike price of $50) for $1, that call will be worth $10 after the jump. The trader will make 900% profit instead of 20%.

The goal of an early warning system is to alert the regulators for further investigations. It is worth noting that a jump in a stock’s price does not always involve insider trading, even though all the traces suggest abnormalities. Financial Industry Regulatory Authority (FINRA)’s Office of Fraud Detection and Market Intelligence (OFDMI) has this special mission. OFDMI structures its organization into four units: (i) Insider Trading Surveillance Group, (ii) Fraud Surveillance Group, (iii) Central Review Group, and (iv) Office of the Whistleblower. Listen to this podcast for their operation of finding illegal insider trading.

Some Well-known Stock Price Manipulations

You may have heard “pump-and-dump” and “spoof trading” on the news. Pump-and-dump is a manipulative method that buys a stock, pushing its price up, then dumps all of the stock to make a profit. Spoof trading is a manipulative method that tricks other investors to buy or sell at the manipulated price.

Figure (I): Pump and dump

Traces Evidence on Insider Trading

When people trade on inside information, they leave traces in trading data. Trading volumes are often unusually high and price movements are unusual. This is especially true in “thinly traded” securities (ones that usually have low trading volumes) because a small amount of insider trading has a larger impact on the overall trading.

Use Data to Detect Price Manipulations

Surveillance systems are built to find trace evidence of insider trading. The news is the “trigger” that begins the search for unusual trading that preceded the news. The Market Regulation Department of the National Association of Securities Dealers (NASD) has built two major “break detection” systems — the Advanced Detection System (ADS) and Securities Observation, News Analysis, and Regulation (SONAR) — for surveillance of the Nasdaq and several other markets. Besides detecting illegal trading, the systems also can be used to prevent terrorist attacks.

A data analyst will use all data sources including news, texts, daily stock prices or tick prices, company information, etc. to locate any price manipulations. The trade data can be classified into two levels. Level 1 data are trades successfully executed. It is the open-high-low-close price and volume within a specific time period. Level 2 data include Level 1 data and buy/sell orders that are not matched. It shows each particular order that is entered, canceled, or matched.

Create Features to Detect

To create signals to identify potential pump and dump scheme is just the initial step, and it is not easy. We have to be very creative to create the signals or in the data science term “features”. The features may pick up stock movements that are perfectly normal so the signal becomes false positive. Our job is to find abnormal trading efficiently and effectively, in other words, with a smaller false positive rate. Figure (II) is a hypothetical “pump-and-dump” scheme (as circled). You may apply the 5-day and 10-day moving average curves to spot the potential scenario. You also reference news or insider trading information for the same time period to get more insights. Besides price movement, you also can monitor volume changes. The bottom part of Figure (II) monitors the volume changes.

A Hypothetical Example

Here we select a small stock “Lee and Man Paper Manufacturing Limited”, symbol LMPMY, to create features. When you use getSymbols() , it loads the historical prices of the stock in a dataset. The data has open-high-low-closed and volume information. I use the R library quantmod and TTR . that are popular in stock market analysis.