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 uptrend or downtrend of stocks
I'm new in the forum. Is there a way a scan can be written to find stocks within a year having an uptrend of 20% increase or higher (20% decrease) in its value?
and [close > 251 days ago close * 1.2]
That says, today's close is greater than a year ago's close (there are about 251 trading days in a year) plus 20%.
and [close < 251 days ago close * .8]
That says, today's close is at least 20% less than the close a year ago.
Neither scan tells you how price behaved in between a year ago and today. So there may or may not have been a steady up trend or down trend between now and then (in fact, it's unlikely given the corona drop). More likely, for most stocks, there have been several trends, with a net result of an increase or decrease between the two dates.
and [PctChange(10,close) > 10]
This is saying that the percentage change in the last 10 days is 10.00001% or greater.
To get a year greater than 20% you change the first 10 to 251 and the second 10 to 20
and [PctChange(251,close) > 20]
You can also "convert" to weekly or monthly with modifiers
and [weekly PctChange(52,weekly close) > 20]
and [monthly PctChange(12,monthly close) > 20]
To get a Decrease, you'd just change the > to a <.
I use the PctChange in Seasonality scans, among other scans.
You can even use it in the Rank By statement, at the end of a scan to sort the scan.
Rank by [PctChange(251,close)]
Rank by is a great way to add data to the output that you can export, as well as providing a sort order you can save into a ChartList