The Motley Fool Discussion Boards

Previous Page

Investing/Strategies / Mechanical Investing


Subject:  Re: GTR1 random operator? Date:  7/4/2020  9:30 PM
Author:  aussi Number:  278304 of 279022

Here is one way for getting "random" stock list discussed in message 247141.

The first step of my screen is essentially going to randomly divide the market into 90 groups. I do so by grouping stocks according to the first two significant digits of their security-specific actual shares outstanding. Thus, for example, if two stocks A and B have shares outstanding 5,628,299,182 and 56,389,491, respectively, then they are in the same group, because their shares outstanding both begin with "56". The GTR1 expression for calculating the first two significant digits is


(Note to nerds: While the formula is mathematically correct, don't expect it to work perfectly in the wacky world of 32-bit floating point representations.)

My screen will select one of these 90 groups and then further screen for 5 stocks using more reasonable steps:

ratio(gprc(1),hgprc(1,252)) top 50%
trp(1,20) top 5

The first of these two steps takes the top 50% by the ratio of price to 52-week high, while the second step takes the top 5 stocks by four-week total return. The link to the parameterizable family of screens is this:

Now, I'm going to simulate a good dataminer and test all 90 possible variants of this strategy at once. Click "Run Backtest", and when the parameter value box appears, enter a vertical list of the numbers 10, 11, 12, ... 99 and click "Run Backtest".
Copyright 1996-2020 trademark and the "Fool" logo is a trademark of The Motley Fool, Inc. Contact Us