Ok, this should do the trick.
It took me a while to find this because you did not use the exact study name as it appears in Thinkorswim. To avoid confusion in the future, please be sure to use the exact name of the study as it appears on Thinkorswim. In this case the study name is: AccumDistBuyPr
IMPORTANT NOTE:
The actual values at the last bar on the chart will vary because this indicator computes the total sum of values for the entire chart. However both indicators will plot the same trend-patterns given equivalent data. On Thinkorswim we can control how many bars are on the chart. For example for a daily chart we can include 1 yr, 2 yr, 3 yr... etc. For each of these time spans the AccumDistBuyPr study will compute different values (but the same trend-patterns). On Trading view this time span is not adjustable.
HEADS UP:
This should give everyone a heads up. The absolute values of this study (whether used on Thinkorswim or TradingView) are useless. This indicator can only be used to determine trend direction.
TradingView Code:
//@version=3
study(title="Accumulation/Distribution Buying Pressure", shorttitle="AccumDistBuyPr", overlay=false)
data = close > close[1] ? close - min(close[1], low) : close < close[1] ? close - max(close[1], high) : 0
plot(cum(data), title="AccumDistBuyPr", color=red)