Select Page

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:

1. 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.
2. 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.
3. Compute 1/formation days standard deviations.
4. 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.
5. Conservative 1/standard deviation weights: sum 1/stdev for all 15 stocks, weights = (1/stdev)/sum, apply momentum as in step 4.
6. Aggressive equal weights: weights = 1/# of stocks with positive momentum, else 0.0.
7. 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

NameEqual Weight1/Standard Deviation Weight
SMLRSemler Scientific0.06670.0373
TANHTantech0.06670.1942
ZEVLightning eMotors0.06670.0447
PXSPyxis Tankers0.00.0
VIEWView0.06670.0263
DDominion Energy0.00.0
BJDXBluejay Diagnostics0.06670.0362
OTMOOtonomo Technologies Ltd.0.06670.1491
LBCLuther Burbank0.06670.1404
UBERUber Technologies0.06670.0134
ROPRoper Technologies0.06670.004
HCTIHealthcare Triangle0.06670.0469
INVOInvo BioScience0.06670.091
BHGBright Health Group0.06670.013
BIL1-3 Month T-Bill ETF0.13330.1387

## Aggressive Weights

NameEqual Weight1/Standard Deviation Weight
SMLRSemler Scientific0.07690.0433
TANHTantech0.07690.2255
ZEVLightning eMotors0.07690.052
PXSPyxis Tankers0.00.0
VIEWView0.07690.0305
DDominion Energy0.00.0