In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.
//Accumulative Swing Index //By Rob Pecoraro //Feel free to use it! //If you change it, improve it or alter it, just give me props in a comment! study("ASI", overlay=false) a = high - close b = low - close c = high - low L = input(30000, minval=1) K = max((high-close), (low-close)) TR1 = max(a, b) TR2 = c TR = iff(TR1>TR2, TR1, TR2) ER = iff(a > b, (high-close)-.5*(low-close)+.25*(close-open), iff(b > c, (low-close)-.5*(high-close)+.25*(close-open),(high-low)+.25*(close-open))) SH = close-open R = TR-.5*ER+.25*SH si = 50*(((close-close)+.5*(close-open)+.25*(close-open))/R)*(K/L) asi = si+si plot(asi, "Fast",black, 2)