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.
//@version=2 study("My Script", overlay=true) is_down_bar = change(close) < (close[1] * -0.002) ? true : false is_volume_up = change(volume) > 0 ? true : false is_distribution = is_down_bar and is_volume_up ? true : false plotshape(series=is_distribution)