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.

Percentage above the 52-Week Low

I'm new to writing scans. I want to scan for stocks that are 50% or more above the 52-Week Low. Is this correct? Thx in advance.

and [close >= Min(253, Daily Low) * 0.5]

Answers

  • When using decimals as per cents, 1.0 represents the base value - the known value you want to compare unknown values to. So, min(253, low) is the known value, or 1.0.

    If you ask for 0.5 x the base value, you are asking for half the base value - in other words, values BELOW min(253,low).

    But, you want prices 50% higher than the base value - or, another (better - meaning more clear) way of saying that is, 150% of the base value, or in decimals, 1.5 x the base value.

    So, this should work:

    and [close >= Min(253, Daily Low) * 1.5]
  • Thx alot Markd!! I'm trying a different approach. I think I got it and I'm getting a error on the scan but the scan still runs. Operator needed error. Could you please check what is wrong?

    and [[[Max(253,High) - Min(253,Low)] / [Min(253,Low)]] * 100 > 50]
  • Assuming you are looking for prices above the middle of the yearly range:

    and [close > min(253,low) + [[max(253,high) - min(253,high)] * .5]]

    A similar, but not identical scan would be

    and [close > middle Price Chan(253)]
  • Great! I'll give it a try. :)
  • lmkwinlmkwin ✭✭
    depending on your universe, you could also use this in the Rank By statement at the end of the scan. Let's say you have a chartlist(s) and you want to see how they 'rank' in relation to the middle Price Chan(253), or price high or low or pretty much whatever criteria want. A simple scan like:

    //Select one or more of your lists using the dropdown in the workbench
    My List #1
    or My List #14

    Rank by [close / middle Price Chan(253)]

    This will sort your list(s) in descending result of the rank by statement. It will also show the result of the rank by in the last column in the results. You can then save your results in that order if desired. The Value won't be stored, the ranking will. If you want to have the value stored, you'd have to export to csv and then import the properly formatted csv into a chartlist.

    In this case they would be ranked in descending Percentage value away from the middle price channel specified. With the ones higher percent above the MPC listed 1st.

    If your last column in the results is not the rank by value then you have an issue with the rank by statement that it didn't like, so therefore, ignored. Fix it and try again.

    Also make sure that you SELECT your chartlist(s) using the dropdown in the workbench. DO NOT type them in.

    Properly formatted csv is Column A imported into the Symbol Column B is imported into the Name field Column C is imported into the Notes field. No header row allowed.
Sign In or Register to comment.