Pull back since 52wk high


Category:
0
0

Hi Pete,

I’m trying to create a scan to run each morning that will find optionable stocks that hit a 52 week high the previous day and are now trading 3-5% below that high.  It would be a bonus if the scan found only the highs that were reached on a single day gain of +20%. For example, if today is 2/26… the stock surged 25% (reaching a new 52wk high) on 2/25 and has now pulled back a few percentage points from that high.

I have tried “splicing” together some of your codes but that hasn’t seemed to work.

I don’t even know if this is possible, but figured you’d be the guy, if any, to pull it off.

Any help is appreciated.

Thanks.

RESOLVED
Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on February 28, 2021 1:16 pm
201 views
0
Backtested it and it seems to work perfectly. YOU are awesome. Thanks for your help!!!!!
( at February 28, 2021 5:48 pm)
0
How would I add a "pullback range" rather than percent greater than? I added inputs for pullbackMax and a pullbackMin then added "def Range = is between pullbackMax and pullbackMin" and plotted the range. It does not work however.
( at February 28, 2021 6:04 pm)
0
You need to include details like this from the very start. Very often the structure of the entire code needs to be reworked in order to facilitate even a very tiny modification.
( at February 28, 2021 6:16 pm)
0
Private answer

I think this should do it. I only tested it for errors and did not check to see if it works as described. Next time be sure to provide an example stock or screenshot so we have something to use for testing things out.

User inputs are included so the rest of our viewers will be able to adjust things to meet their particular preferences.

input longTermBars = 251;
input percentGain = 20.0;
input percentPullback = 5.0;
def newLongTermHigh = high > Highest(high[1], longTermBars);
def bigOneDayGain = 100 * (high / close[1] - 1) > percentGain;
def pullbackDay = 100 * (close / high[1] - 1) < -percentPullback;
plot scan = newLongTermHigh[1] and bigOneDayGain[1] and pullbackDay;

Marked as spam
Posted by (Questions: 37, Answers: 4079)
Answered on February 28, 2021 3:07 pm