We construct a stock portfolio based on the assumption that stocks will revert to a given index represented by an ETF. In the example here, we use the entire stock market and VTI, the total stock market ETF. Slopes of zsore prices are the measure of deviation from VTI as well as the basis for computing weights.

We construct the portfolio as follows:

- Cluster stocks using 126 days of data, transformed into fractional return series, with Dynamic Time Warping and the K-Medoids algorithm (See K-Medoids Clusters With Dynamic Time Warping Distances Have Been Added To Daily Asset Analysis).
- Using stocks only, select those with volume >= 100,000 shares.
- For 126 days, transform all prices to zscores and compute slopes (See Standard Deviation And Slopes Have Been Added To Daily Asset Analysis).
- Divide stocks into two groups: those with slopes greater and lesser than VTI slope. Randomly choose 5 from each such that each stock is in a unique K-Medoids cluster.
- Compute two types of weights. Aggressive weights are proportional to |stock slope – VTI slope|, while conservative weights are proportional to 1/|stock slope – VTI slope|.
- For stocks whose slopes are greater than VTI slope, weights are negative. For stocks whose slopes are less than VTI slope, weights are positive. Thus mean reversion.
- Select and quantify a directional bias. Neutral means 1/2 of the portfolio is long and 1/2 short. Long means 2/3 long and 1/3 short. Short means 1/3 long and 2/3 short. This information is used to normalize the weights.

## 1/2 Long 1/2 Short

Name | Trade Direction | Slope | Delta Slope | 1/Delta Slope | Cluster Number | Aggressive Weights | Conservative Weights | |
---|---|---|---|---|---|---|---|---|

TWST | Twist Bioscience | Long | 0.0045 | 0.0189 | 52.9101 | 64 | 0.1849 | 0.0194 |

RRC | Range Resources | Long | 0.0224 | 0.001 | 1000.0 | 4 | 0.0098 | 0.366 |

NCMI | National CineMedia | Long | 0.009 | 0.0144 | 69.4444 | 86 | 0.1409 | 0.0254 |

ATAI | atai Life Sciences | Long | 0.0137 | 0.0097 | 103.0928 | 20 | 0.0949 | 0.0377 |

NSIT | Insight Enterprises | Long | 0.0163 | 0.0071 | 140.8451 | 10 | 0.0695 | 0.0515 |

SHAK | Shake Shack | Short | 0.0245 | 0.0011 | 909.0909 | 77 | -0.0705 | -0.1178 |

DFH | Dream Finders Homes | Short | 0.026 | 0.0026 | 384.6154 | 60 | -0.1667 | -0.0498 |

LII | Lennox International | Short | 0.0244 | 0.001 | 1000.0 | 18 | -0.0641 | -0.1296 |

HUBB | Hubbell | Short | 0.0243 | 0.0009 | 1111.1111 | 47 | -0.0577 | -0.144 |

FOR | Forestar Group | Short | 0.0256 | 0.0022 | 454.5455 | 31 | -0.141 | -0.0589 |

## 1/3 Long 2/3 Short

Name | Trade Direction | Slope | Delta Slope | 1/Delta Slope | Cluster Number | Aggressive Weights | Conservative Weights | |
---|---|---|---|---|---|---|---|---|

TWST | Twist Bioscience | Long | 0.0045 | 0.0189 | 52.9101 | 64 | 0.1233 | 0.0129 |

RRC | Range Resources | Long | 0.0224 | 0.001 | 1000.0 | 4 | 0.0065 | 0.244 |

NCMI | National CineMedia | Long | 0.009 | 0.0144 | 69.4444 | 86 | 0.0939 | 0.0169 |

ATAI | atai Life Sciences | Long | 0.0137 | 0.0097 | 103.0928 | 20 | 0.0633 | 0.0252 |

NSIT | Insight Enterprises | Long | 0.0163 | 0.0071 | 140.8451 | 10 | 0.0463 | 0.0344 |

SHAK | Shake Shack | Short | 0.0245 | 0.0011 | 909.0909 | 77 | -0.094 | -0.157 |

DFH | Dream Finders Homes | Short | 0.026 | 0.0026 | 384.6154 | 60 | -0.2222 | -0.0664 |

LII | Lennox International | Short | 0.0244 | 0.001 | 1000.0 | 18 | -0.0855 | -0.1727 |

HUBB | Hubbell | Short | 0.0243 | 0.0009 | 1111.1111 | 47 | -0.0769 | -0.1919 |

FOR | Forestar Group | Short | 0.0256 | 0.0022 | 454.5455 | 31 | -0.188 | -0.0785 |

## 2/3 Long 1/3 Short

Name | Trade Direction | Slope | Delta Slope | 1/Delta Slope | Cluster Number | Aggressive Weights | Conservative Weights | |
---|---|---|---|---|---|---|---|---|

TWST | Twist Bioscience | Long | 0.0045 | 0.0189 | 52.9101 | 64 | 0.2466 | 0.0258 |

RRC | Range Resources | Long | 0.0224 | 0.001 | 1000.0 | 4 | 0.013 | 0.4879 |

NCMI | National CineMedia | Long | 0.009 | 0.0144 | 69.4444 | 86 | 0.1879 | 0.0339 |

ATAI | atai Life Sciences | Long | 0.0137 | 0.0097 | 103.0928 | 20 | 0.1265 | 0.0503 |

NSIT | Insight Enterprises | Long | 0.0163 | 0.0071 | 140.8451 | 10 | 0.0926 | 0.0687 |

SHAK | Shake Shack | Short | 0.0245 | 0.0011 | 909.0909 | 77 | -0.047 | -0.0785 |

DFH | Dream Finders Homes | Short | 0.026 | 0.0026 | 384.6154 | 60 | -0.1111 | -0.0332 |

LII | Lennox International | Short | 0.0244 | 0.001 | 1000.0 | 18 | -0.0427 | -0.0864 |

HUBB | Hubbell | Short | 0.0243 | 0.0009 | 1111.1111 | 47 | -0.0385 | -0.096 |

FOR | Forestar Group | Short | 0.0256 | 0.0022 | 454.5455 | 31 | -0.094 | -0.0393 |

We note that all of the data was directly taken from data that we compute each market day (available at our Proton Drive). Specifically, data was from:

- Dynamic Time Warping Nearest Neighbors And K-Medoids Clusters 2023-08-04.zip: Dynamic Time Warping Nearest Neighbors Fractional Return 126 Days Stocks.csv
- Analysis 2023-08-04.zip: Slope Zscore Arrays.csv

We could have performed a fresh clustering at the end of step 4 above for each of the two divisions of stocks, but we wanted to highlight a use case for the data that we compute each market day.

If you find such information useful, we ask that you provide value in return via the Value 4 Value links on theĀ homepage. We would also appreciate you spreading the word about our work.