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 trends

Hi all,

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.



  • markdmarkd mod
    edited October 2015
    You could write a scan that looks at a long term moving average, like the daily 200 or the weekly 40 at several points in time, and compares the later points to the earlier points. If you want an up trend, the later points should be greater; for a down trend, they should be less.

    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.
  • markdmarkd mod
    edited October 2015
    Another possibility for up trends:

    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
Sign In or Register to comment.