This code is to replicate the relative strength indicator as used on investors.com (on lists like the IBD 50, big cap 20 etc).
Let me know if any issues / any updates wanted.
This script automatically flags distribution days. Distribution days are defined as any day that is down -0.2% or greater on heavier volume than the previous day. Distribution days are counted on the major indexes (S&P 500, NASDAQ, NYSE, etc...) within the CANSLIM methodology.