New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.
52 Week High from Previous 5 Days
What is the correct syntax to scan for stocks that have reached a 52 week high from the past 5 days? Thank you for our help...
0
Answers
I went to school at Michigan State University during the era when the football program was not so good. I'm proud to raise the "flag" that I've hidden in the closet for many years...Go Spartans
Sorry to hi jack the post but if i am looking to scan a 52 week high from the last 15 days, it would be
[15 days ago close > 16 days ago max(251, close)]
thanks
All of these scan versions pick up the exact day of crossing - so your scan would get you a crossing exactly 15 days ago, not "within" the last fifteen days.
A scan to pick up all crossings "within" a period of time would be really complex and in a rising market would get more hits than you could look at easily (unless you limit the universe pretty narrowly). So I think it's better to write it for "today", and then use the calendar tool to select past dates.
I've been working on the syntax that markd originally sent to me. I combined the request from morganj71 to scan a 52 week high WITHIN the last 15 days. Here is the modified version to the syntax (note: the use of BRACKETS to group clauses of "OR").
In my modify version I was interested in finding stocks whose close are greater than the 52 week high WITHIN the past 5 days. Again the key to this is to have brackets that group clauses of "OR".
AND [[Daily Close > Yesterday's Daily MAX(251,Daily High)]
OR [Yesterday's Daily Close > 2 days ago Daily MAX(251,Daily High)]
OR [2 days ago Daily Close > 3 days ago Daily MAX(251,Daily High)]
OR [3 days ago Daily Close > 4 days ago Daily MAX(251,Daily High)]
OR [4 days ago Daily Close > 5 days ago Daily MAX(251,Daily High)]]
# This scan looks to find 52-Week daily close greater that 52 week high from within the past 5 days.
# Note the use of brackets to close groups of clauses using "OR"
I hope this helps...Happy Trading!!!