Screening for highflying stocks

Hi,

Is there a way how the P123 screener can find all the stocks that were at one point in time at least 20x up vs their previous low?

Using HighVal and LowVal (and HighValBar and LowValBar), I have a solution for currently traded stocks, but this script does not catch stocks that fulfill my screening criteria AND were delisted due to acquisitions etc. in the past.

Is there a way how I could get all ever traded stocks that fulfill my criteria - without going manually through the history and setting my screening date to, for example, “2014-12-31”, “2013-12-31”, and so on?

Thanks in advance for your help!

I think a rule like this should work:

LoopSum("HighVal(252, CTR*252) > 20*LowVal(252*5, HighValBar(252, CTR*252))", 7) >= 1

To start, I begain with the rule below to look for stocks that have a high value over the last 252 bars that is at least 20 times the low value of the preceding 5 years of bars, i.e. offset by the HighValBar:

HighVal(252) > 20*LowVal(252*5, HighValBar(252))

Then I added in a LoopSum to check for this occurring at least once over the past 7 years. I had to limit it to 7 years because the HighVal/LowVal functions are capped at 2000 bars.

I spot checked a few results and it looks correct from the examples I examined, but I would be sure to verify it and also adjust the lookback window to suit your needs.

1 Like

The key here is “ever traded” so you need to use the point in time universe. Only way to do that is running bunch of screens with proper as-of dates or run simulations. For automation you have these options:

  1. Use the API and some code to run a bunch of screens
  2. Run a screen backtest with Save Log enabled (Backtest → Show More)
  3. Run a portfolio backtest and download the transactions

For options 2,3 you will have to do some post processing (in excel for example) to produce a list of unique tickers

1 Like

Thank you, Marco and Feldy! Very helpful.