StockFetcher Forums · General Discussion · Looking for help with writing the code for my filter<< >>Post Follow-up
greatspotter@gmail.com
5 posts
msg #148253
Ignore greatspotter@gmail.com
6/23/2019 5:37:07 PM

Hi
I am trying to find stocks that
1. reached a 90 day high in the last 21 trading sessions.
2. stock reached a lower low than it had in the previous 10 days prior to its 90 day high
3. the stock closed in the upper 75% of its price range that day.

so far I have 1. working
high 21 days ago or less reached a new 90 day high

but I haven't been able to get 1 & 3 to work. Best that I have so far is:
and low is less than low 10 days prior to the new 90 day high
and close is in the upper 75 percentile of its range

any help would be greatly appreciated.

KSK8
561 posts
msg #148255
Ignore KSK8
modified
6/23/2019 6:24:22 PM

Fetcher[


/* reached a 90 day high in the last 21 trading sessions */
set{v1, count(close reached a new 90 day high,21)}
v1 > 0

/* the stock closed in the upper 75% of its price range that day */
set{x1, high - low}
set{x2, close - low}
set{x3, x2 / x1}
set{x4, x3 * 100}
x4 > 75

]



Fetcher[
/* stock reached a lower low than it had in the previous 10 days prior to its 90 day high */
set{z1, count(low 1 day ago reached a new 10 day low 1 day ago,1)}
set{z2, count(close reached a new 90 day high,1)}
set{z3, z1*z2}
set{z4, count(z3 > 0,21)}
z4 > 0
]



This one might require the advanced subscription, there may be an easier way to code it though.




greatspotter@gmail.com
5 posts
msg #148258
Ignore greatspotter@gmail.com
6/24/2019 8:49:09 AM

KSK8
Thank you very much for your help. Unfortunately the last of the three parts is not working. When I run the code, it is not picking up the drop in prices.
I'll keep working on it.
Thanks again

KSK8
561 posts
msg #148259
Ignore KSK8
6/24/2019 9:52:47 AM

Maybe this is what you are looking for;

Fetcher[
/* changed 21 to 1 */
set{z1, count(low 1 day ago reached a new 10 day low 1 day ago,1)}
set{z2, count(close reached a new 90 day high,1)}
set{z3, z1*z2}
set{z4, count(z3 > 0,1)}
z4 > 0
]



greatspotter@gmail.com
5 posts
msg #148261
Ignore greatspotter@gmail.com
6/24/2019 10:49:32 AM

Thanks KSK8
Both stocks indicated did meet the criteria I was looking for.
I will monitor it over the next few days to see if its still good.
Once again, I really appreciate your help

StockFetcher Forums · General Discussion · Looking for help with writing the code for my filter<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.