Original LUA oscillator: http://fxcodebase.com/code/viewtopic.ph ... 3811572bd4.
Formulas:
Direction[i] = Sum(Mom) from (i-Length+1) to (i),
TDI[i] = F+H-G, where
Mom[i] = Price[i]-Price[i-Length],
F = Abs(Direction),
H = Sum(Abs(Mom)) from (i-Length+1) to (i),
G = Sum(Abs(Mom)) form (i-2*Length+1) to (i).
Download: