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.
Options

Range expansion

I have know clue where to begin writing a range expansion scan, any help would be much appreciated.

looking for scam to find:

Today’s range must be equal to or greater than the larges range in the last 9 days.


as this does not seem to work:

and [Range > 1 day ago Max (9, Range)] 

Thank you in advance.

Isabel

Comments

  • Options
    The scan itself seems to work - that is, it runs and it gets what it asks for. But you probably have to add conditions to capture a range expansion situation - by which I assume you mean, a strong reversal of trend.

    So, for a bullish reversal, a simple way might be to test for a close up today and a falling sma of some length - so maybe sma10 less than 10 days ago sma10. For a bearish reversal you would test for the opposite - close down, higher sma vs the recent past.
  • Options
    I typed Range into the Search box at the top and found a couple of links that may assist you.

    https://scan.stockcharts.com/discussion/comment/5898#Comment_5898

    https://scan.stockcharts.com/discussion/comment/5823#Comment_5823

    https://scan.stockcharts.com/discussion/1958/wide-range-bar-off-20-sma/p1

    I see that your scan code passes syntax and actually returns results that meet the requirement you said. If you want them to be "rising" sequentially, perhaps you can add the Streak Up or Count Up function to the scan.

    The Streak function looks for Consecutive periods. In this example, 8 consecutive Up closes.

    and [Streak Up(close) > 8]

    The Count function looks for a fraction. In this example, 8 Up closes out of 10 periods.

    and [Count Up(10, close) > 8]

  • Options

    the Streak and Count function are very helpful, Thank you!

  • Options
    lmkwinlmkwin ✭✭
    edited May 2020
    my syntax was incorrect. I had greater than and it should have been greater than or equal to to match the descriptions. Corrected below.

    The Streak function looks for Consecutive periods. In this example, 8 consecutive Up closes.

    and [Streak Up(close) >= 8]

    The Count function looks for a fraction. In this example, 8 Up closes out of 10 periods.

    and [Count Up(10, close) >= 8]

    Sorry about that.

    You can even use the Count Up, or down, in the Rank By statement of a scan. It's neat.
Sign In or Register to comment.