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.

Code for percent chance on ROC indicator

What would be the scan code for an increase in ROC(20) by a min 5% over 1 day ago, and then rank the results from highest to lowest?

Thank you in advance.

Comments

  • markdmarkd ✭✭✭
    The first part is straightforward:

    and [ROC(20) > 1 day ago ROC(20) * 1.05]

    The "rank by" command will not give you a syntax error if you put a custom calculation after it, but it will not necessarily deliver the results you expect. I contacted support about this, and the reply was, essentially, the "rank by" command is meant to be used with "built in" indicators (like MACD, say) or values (like market cap, or industry, etc.).

    You could try

    rank by ROC(1)

    although that ranks them by largest per cent change in price, which is not necessarily the same as largest change in the indicator. But the two are likely to coincide most to the time, I would think.


  • markdmarkd ✭✭✭
    Or, you could try


    rank by PctChange(1,ROC(20))

    but I don't know if the results are reliable.
Sign In or Register to comment.