#### Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

# Scanning for 52 Week High

Attempting to create a scan to select stocks making a new 52 week high in price.
First scan used the following but not looking to scan day over day change from day 2 to day 3

[TYPE = STOCK] AND [SMA20,VOLUME) > 40000]
and [type is stock]
and [group is TechnologySector]
and [group is HealthCareSector]
AND [2 DAYS AGO HIGH > 3 DAYS AGO DAILY MAX(253,HIGH)]

[TYPE = STOCK] AND [SMA20,VOLUME) > 40000]
and [type is stock]
and [group is TechnologySector]
and [group is HealthCareSector]
AND [TODAY’S HIGH > YESTERDAY’S DAILY MAX(253,HIGH)]

There are mismatched square brackets. Make sure that the number of left and right square brackets are equal.

To me the brackets match, what am I missing please?

• mod
edited September 2021
[TYPE = STOCK] AND [SMA20,VOLUME) > 40000]

should be

[TYPE = STOCK] AND [SMA(20,VOLUME) > 40000]

You need a parens after SMA and before 20 to complete the function syntax (like did do correctly with the MAX( ) function).

The error message is misleading, although it should point out the line where the error is (or the line where the scan engine detects the error - which could be the actual line or sometimes the line just before or after the error).

Also, if you are using the Advanced Scan Editor, any line with an error should have a red square with an "x" next to it. If you run the cursor over the red square it will tell you what's wrong (usually).

Also, your logic will yield 0 results even if you correct the syntax error because no symbol belongs to more than one sector. So, you need to ask for symbols that belong to one sector OR another sector, not AND another sector. Like this:

[TYPE = STOCK] AND [SMA(20,VOLUME) > 40000]

and

[
[group is TechnologySector]
or
[group is HealthCareSector]
]

AND [TODAY’S HIGH > YESTERDAY’S DAILY MAX(253,HIGH)]
• ✭✭
The error messages often aren't in "common english" but programming english

• mod
Wow, looks like they've been working on the editor. The last line of the grey box actually identifies the error exactly - "Missing left parenthesis ( ". That's pretty good.

On the other hand, they list every other possible error first, but at least there's some guidance. I wonder what the "click here to fix" does. Does it actually fix it?

They could change "parse" to "read" or "make sense of" in the pink box to clean up the jargon.
• ✭✭
It adds the default code in for the error. Doesn't fix it but does do something to help.

[TYPE = STOCK] AND [SMA(50,volume)20,VOLUME) > 40000]