thinkorswim does have a "WilliamsAD" study but it is missing the simple moving average and does not show crossovers.
- https://www.investopedia.com/terms/a/accumulationdistribution.asp
- https://www.tradingview.com/script/budDCi5L-CM-Williams-AD-SMA-V1-Public/
Code:
declare lower;
input length = 20;
plot ad = AccumDistBuyPr();
plot smoothed = SimpleMovingAvg(ad, length=length);
smoothed.AssignValueColor(Color.WHITE);
ad.DefineColor("Up", Color.GREEN);
ad.DefineColor("Down", Color.RED);
ad.AssignValueColor(if ad > smoothed then ad.color("Up") else ad.color("Down"));