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.
Scanning for the first 200 day New High after a 200 day New Low
Hi,
I am an experienced SC Scan Workbench user but need a nudge in the right direction. I would like to write a scan that identifies stocks making their first 200 day high after making a 200 day low. Writing the scan for the 200 day new high is pretty easy. I'm having trouble writing the scan language to capture the first 200 day high since making a 200 day low.
Any help would be greatly appreciated. Thank you.
0
Answers
If you make the assumption that the 200 day price channels are falling when the new 200 day high occurs, your scan could be this:
[exchange is NASD] // or whatever
and [high x 1 day ago Upper Price Chan(200)]
and [Upper Price Chan(200) = min(200, Upper Price Chan(200))]
and [Lower Price Chan(200) = min(200, Lower Price Chan(200))]
The mins insure the channels have been falling and haven't ticked up any time in the last 200 days.
But, it may be the case that both channels do NOT have to be falling or flat to meet your first 200 day new high condition. It may be possible that the Lower channel can start rising before price gets back above the upper channel. Also, there may be special cases where sharp price changes mean you could get a new low and a new high within a say a couple of weeks or a month. But that implies a narrow range or a special situation - something probably not tradable.
The code above does get valid results, but not many, possibly due to the state of the market. You could set the start date back to see what happens.