For who knows what reason, percent price change has been designated “momentum” in financial jargon. Typically, momentum is used to measure trends and is then applied to trend following systems as an entry signal. We do the same here, trading a portfolio of stocks and only taking positions if momentum is positive.

The twist is to use dynamic time warping distances and k-medoids clustering to select a portfolio. Additionally, we compute four sets of weights, conservative using the T-bill ETF (BIL) as the cash component and aggressive which does not use cash and both equal weights and weights proportional to the reciprocal of the standard deviation.

Here are the steps:

- Set the following parameters: 100 formation days, fractional return paa representation with 10 pieces each of length 10 days, average volume for the formation days >= 100,000, 15 stocks in the portfolio.
- Transform the data into the fractional return paa representation, using dynamic time warping distances compute k-medoids clusters with 15 clusters in which the medoids are the stocks in the portfolio.
- Compute 1/formation days standard deviations.
- Conservative equal weights: weights = 1/15 if momentum > 0, else are set to 0.0, the residual weight (1.0 – sum of weights) is assigned to BIL.
- Conservative 1/standard deviation weights: sum 1/stdev for all 15 stocks, weights = (1/stdev)/sum, apply momentum as in step 4.
- Aggressive equal weights: weights = 1/# of stocks with positive momentum, else 0.0.
- Aggressive 1/standard deviation weights: same as step 5 but the sum is only for stocks with positive momentum, for non-positive momentum stocks, weights are set to 0.0.

## Conservative Weights

Name | Equal Weight | 1/Standard Deviation Weight | |
---|---|---|---|

SMLR | Semler Scientific | 0.0667 | 0.0373 |

TANH | Tantech | 0.0667 | 0.1942 |

ZEV | Lightning eMotors | 0.0667 | 0.0447 |

PXS | Pyxis Tankers | 0.0 | 0.0 |

VIEW | View | 0.0667 | 0.0263 |

D | Dominion Energy | 0.0 | 0.0 |

HUDI | Huadi International Group Co. | 0.0667 | 0.0647 |

BJDX | Bluejay Diagnostics | 0.0667 | 0.0362 |

OTMO | Otonomo Technologies Ltd. | 0.0667 | 0.1491 |

LBC | Luther Burbank | 0.0667 | 0.1404 |

UBER | Uber Technologies | 0.0667 | 0.0134 |

ROP | Roper Technologies | 0.0667 | 0.004 |

HCTI | Healthcare Triangle | 0.0667 | 0.0469 |

INVO | Invo BioScience | 0.0667 | 0.091 |

BHG | Bright Health Group | 0.0667 | 0.013 |

BIL | 1-3 Month T-Bill ETF | 0.1333 | 0.1387 |

## Aggressive Weights

Name | Equal Weight | 1/Standard Deviation Weight | |
---|---|---|---|

SMLR | Semler Scientific | 0.0769 | 0.0433 |

TANH | Tantech | 0.0769 | 0.2255 |

ZEV | Lightning eMotors | 0.0769 | 0.052 |

PXS | Pyxis Tankers | 0.0 | 0.0 |

VIEW | View | 0.0769 | 0.0305 |

D | Dominion Energy | 0.0 | 0.0 |

HUDI | Huadi International Group Co. | 0.0769 | 0.0752 |

BJDX | Bluejay Diagnostics | 0.0769 | 0.042 |

OTMO | Otonomo Technologies Ltd. | 0.0769 | 0.1731 |

LBC | Luther Burbank | 0.0769 | 0.163 |

UBER | Uber Technologies | 0.0769 | 0.0155 |

ROP | Roper Technologies | 0.0769 | 0.0046 |

HCTI | Healthcare Triangle | 0.0769 | 0.0544 |

INVO | Invo BioScience | 0.0769 | 0.1056 |

BHG | Bright Health Group | 0.0769 | 0.0151 |

Clustering serves the desire to create a diversified portfolio. Rather than making assumptions based on economic sector, industry, etc. we use distance to measure (dis)similarity which is then fed into a cluster algorithm to yield a portfolio of stocks that are not moving in lock step. Additionally, clustering with momentum also provides a snap shot of the state of the market and the ability to express conservative and aggressive views.

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.