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.
cnt = 0
for i = 0 to len
if(is_distribution)
cnt := cnt + 1
plotshape(series=((cnt>cnt[1])?cnt:false))
d.nelle
⋅
@kalle2017, your script does not work for me. It does not stop after 25 days.
kevshah7
⋅
Thanks for posting this script publicly, its been very useful. I'm not very familiar with the pineeditor language so I was hoping if you could help me add in a line in the script to only call out the distribution days when the red volume is above the 50MA line?
Thanks in advance,
Kevin.
Mukadam
⋅
2 things left out in the canslim strategy, after a uptrend has been confirmed only then the distribution days are counted also after every 25 days the previous distribution day is removed.
I added something.
Now it also shows the amount of distribution days within a certain period(days)
//@version=3
study("Distribution Days", overlay=true)
len = input(25, minval=1, title="Days")
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
cnt = 0
for i = 0 to len
if(is_distribution)
cnt := cnt + 1
plotshape(series=((cnt>cnt[1])?cnt:false))