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.
What would be a good way to scan for stocks that are currently in trends (either up or down) and have been for a while? I would obviously like the trend to be as strong as possible, with as little rangebound action as possible.
So, for an uptrend, something like
and [sma(200, close) > 21 days ago sma(200,close)]
and [21 days ago sma(200, close) > 63 days ago sma(200, close)]
and [63 days ago sma(200, close) > 126 days ago sma(200, close)]
For a weekly version, use "weeks ago" and "weekly close".
Another possibility is to test for a stochastic level, with custom parameters:
and [min(251, Fast Stoch %K(251, 1)) > 70]
This says the close has been in the upper 30 per cent of the 251 day range for 251 days.
You can edit all the parameters, including the interval days (21 - 63, 63 -126, 251) and the sma and Stoch lengths (200, 251) to see what happens.
and [slope(50, sma(200, close)) > .05]
For down trends:
and [slope(50, sma(200, close)) < -0.15]
Again, play with the parameters 50, 200 and .05, -.015