**Geometric Patterns Predict Stock Returns**

August 15, 2017

View full report here.

Computational Algorithms

The geometric strategy identifies trend reversals in stock prices by recognizing significant price points than make sure a specific shape. These patterns trigger signals on both the long and short side, outperforming a randomly selected portfolio during our testing period from 2014-2016.

Preprocessing

We input historical closing prices for the top 25 market capitalization companies in the Nasdaq exchange from 2006-2017. Each data point is converter to a return, creating a stationary variable proper for prediction. In this research we focus only on the framework for a daily trading strategy, using end of day closing prices.

Stock volatility external market forces makes future prices harder to predict. We apply a smoothing technique to more easily track the trend of our data. Empirical mode decomposition, kernel regression and exponential smoothing are methods we test, finding kernel regression to work best. Figure 1. shows original Apple closing price compared to a smoothed time series.

The new price series takes a version of mean and calculates long-term averages with lower volatility. We tune the bandwidth parameter to determine the width of the kernel used, in our case, how many days to use for smoothing. Figure 2. displays the effect different parameters have on an original time series.

The larger the parameter, the smoother the data, but you are avoiding the risk of missing information. One option is to set a fixed bandwidth, such at 0.2. A more optimal technique is to use cross validation, which iterates between multiple options for bandwidth and calculate the mean squared error for different parameters. This gives a more optimal solution, but costs us processing time to calculate on a daily basis. To save processing time, we test in-sample and out-of-sample results and identify how robust the result is. We find that 2.0/2,800 is the optimal solution, because 2.0 was our initial bandwidth and 2,800 data points were in our sample size. Finally we have our fitted curve.

Extrema Signals

We identify maximum points in the function by looking at three consecutive points to see if they meet the criteria: E1<E2>E3. If the smoothed stock data identifies a local maximum, or the inverse (local minimum) then we move to the original data and find the position of the same extrema point. Figure 3. shows a time series with the smoothed extremas and their points on raw data.

Developing Geometric Patterns

We develop four unique patterns, each of which uses the extrema points from Figure 3. as their inputs.

The five points that create the AlgoX pattern are illustrated in Figure 4. On the fifth point, we receive a buy signal.

Parameter Optimization

We now have the signals for entering positions and optimize them for holding period and risk controls using grid search. Grid search is a model used to search through combination of variables and outcomes to determine the optimal set. For each pattern, we apply this technique for two parameters in two in-sample tests. Its benefit is that we can analyze all possible combinations in a faster time, as shown in Figure 5.

First we look at 2012-2014 for all patterns and their unique parameters, analyzing their win rate, profit, and drawdown during this period. We then select the top four sets of parameters for each pattern to test the period of the financial crisis to see performance during a bull-bear-bull market. From these four sets of parameters for each strategy, we finally select one best performer to analyze the results out of sample.

Strategy

Our portfolio is allocated across the four geometric patterns.

Holding period and risk controls vary by s