Scan for new 52-week highs in the last 10 days?

I am trying to determine the scan for any stocks that have hit new 52 week highs in the last 10 days. Does anyone have something like this? Below is what i have and it is not working. Any input is greatly appreciated. thanks!

[type = stock]
and [Close > 3]
and [Close < 1000]
and [Volume > 400,000]
and [country is US]
and [today's high > yesterday's daily max(253,high)]
Or [yesterday's high > 2 days ago daily max(253,high)]
!! works to this point; below here it syntax is right, results are off
or [2 days ago daily high > 3 days ago daily max(253,high)]
or [3 days ago daily high > 4 days ago daily max(253,high)]
or [4 days ago daily high > 5 days ago daily max(253,high)]
or [5 days ago daily high > 6 days ago daily max(253,high)]

Comments

  • markd
    markd mod
    edited June 2021
    You need to have a pair of brackets around your "or" conditions to treat them as one statement.
    ...
    and [country is US]
    and
    [

    [today's high > yesterday's daily max(253,high)]
    or [yesterday's high > 2 days ago daily max(253,high)]
    or [2 days ago daily high > 3 days ago daily max(253,high)]
    or [3 days ago daily high > 4 days ago daily max(253,high)]
    or [4 days ago daily high > 5 days ago daily max(253,high)]
    or [5 days ago daily high > 6 days ago daily max(253,high)]

    ]

    Also, while your approach of comparing successive highs should work, you could do it with just an "=" operator:

    and

    [
    [high = max(253, high)]
    or [1 day ago high = 1day ago max(253, high)]
    or [2 days ago high = 2 days ago max(253, high)]
    or etc.

    ]