Skip to main content
No. of Recommendations: 3
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

int(ratio(sho.a,pow(10,linear(1,int(ratio(ln(sho.a),ln(linear(10,1)))),-1,1))))

(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: http://gtr1.backtest.org/2012/?s19970902e20051230::sho.a:gt0......

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".
Print the post  

Announcements

What was Your Dumbest Investment?
Share it with us -- and learn from others' stories of flubs.
When Life Gives You Lemons
We all have had hardships and made poor decisions. The important thing is how we respond and grow. Read the story of a Fool who started from nothing, and looks to gain everything.
Contact Us
Contact Customer Service and other Fool departments here.
Work for Fools?
Winner of the Washingtonian great places to work, and Glassdoor #1 Company to Work For 2015! Have access to all of TMF's online and email products for FREE, and be paid for your contributions to TMF! Click the link and start your Fool career.