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.

20 week breakout

I cant seem to make "weekly", "week", "last weeks" terms work. I am looking to do a scan for weekly close over the past 20 weeks

This has errors:
[volume > 300]
and [weekly high > weekly max(20,high)]

Thanks!

Comments

  • Data elements inside a function (high, in this case) also need the time frame modifier. The scan engine always assumes you mean "daily" unless you say differently.

    Also, to be consistent, you want a weekly volume number as well (so you might want to jack up the number, depending on what you are looking for).

    [weekly volume > 300]
    and [weekly high > weekly max(20,weekly high)]
  • Thank you Markd. I am surprised that there were no results even when using only the second line. I will continue to monitor it.
  • markdmarkd mod
    edited October 2020
    Now that I look at the logic and not just the syntax...

    You get no results because the condition cannot be true - if this week's high is the max, it can't be greater than the max, only equal. If another week's high is the max, this weeks' high can't be greater (or this week's high WOULD BE the max).

    So, you need to compare this week's high to the 1 week ago max high - like this:

    and [weekly high > 1 week ago weekly max(20,weekly high)]
  • Thanks - Markd (or others) - This seems to include items that have made multiple new highs for weeks. Could you suggest a way to add a line that limits the results to first time 20 week breakout?
  • One way to do that would be to test for a channel break after the channel has been flat for some number of weeks. For instance

    and [weekly high x weekly Upper Price Chan(20)]
    and [1 week ago weekly Upper Price Chan(20) = 10 weeks ago weekly Upper Price Chan(20)]

    You could change "weekly high" to "weekly close". You could change "10 weeks ago" to some other number (less than 20).

    The upper price channel represents the highest price in the last 20 weeks - but that is not necessarily 20 weeks ago. The highest price in twenty weeks might have occurred last week or five weeks ago or fifteen or 20 weeks ago. Using "10 weeks ago" insures the highest price in the last 20 weeks was at least 10 weeks ago - maybe more. If you play with that number you can see what length of straight channel gets the kind of results you want to work with.
  • Great. thanks for all your help!
Sign In or Register to comment.