Coral Trend Indicator

I like the Coral Trend indicator a lot for use in trend following systems paired with another oscillator.

Unfortunately, I’m trying to find something similar in Tradovate. The closest I can get is the Tiki ADX, and it’s imperfect at best. Here’s a pinescript version of the Coral code. Coral Trend Indicator [LazyBear] by LazyBear — TradingView

I’m fairly new to tradovate, so is the best option really to code it as a custom indicator in the editor?

study(title=“Coral Trend Indicator [LazyBear]”, shorttitle=“CTI_LB”, overlay=true)
src=close
sm =input(21, title=“Smoothing Period”)
cd = input(0.4, title=“Constant D”)
ebc=input(false, title=“Color Bars”)
ribm=input(false, title=“Ribbon Mode”)
di = (sm - 1.0) / 2.0 + 1.0
c1 = 2 / (di + 1.0)
c2 = 1 - c1
c3 = 3.0 * (cd * cd + cd * cd * cd)
c4 = -3.0 * (2.0 * cd * cd + cd + cd * cd * cd)
c5 = 3.0 * cd + 1.0 + cd * cd * cd + 3.0 * cd * cd
i1 = c1src + c2nz(i1[1])
i2 = c1i1 + c2nz(i2[1])
i3 = c1i2 + c2nz(i3[1])
i4 = c1i3 + c2nz(i4[1])
i5 = c1i4 + c2nz(i5[1])
i6 = c1i5 + c2nz(i6[1])

bfr = -cdcdcdi6 + c3(i5) + c4*(i4) + c5*(i3)
// --------------------------------------------------------------------------
// For the Pinescript coders: Determining trend based on the mintick step.
// --------------------------------------------------------------------------
//bfrC = bfr - nz(bfr[1]) > syminfo.mintick ? green : bfr - nz(bfr[1]) < syminfo.mintick ? red : blue
bfrC = bfr > nz(bfr[1]) ? green : bfr < nz(bfr[1]) ? red : blue
tc=ebc?gray:bfrC
plot(ribm?na:bfr, title=“Trend”, linewidth=3, style=circles, color=tc)
bgcolor(ribm?bfrC:na, transp=50)
barcolor(ebc?bfrC:na)