//@version=3
// Copyright (c) 2018-present, Alex Orekhov (everget)
// T3 indicator script may be freely distributed under the MIT license.
study(title="T3", shorttitle="T3", overlay=true)
len = input(title="Length", type=integer, defval=5, minval=1)
factor = input(title="Factor", type=float, defval=0.7, minval=0, maxval=1)
src = input(title="Source", type=source, defval=close)
gd(series, length) => ema(series, length) * (1 + factor) - ema(ema(series, length), length) * factor
t3 = gd(gd(gd(src, len), len), len)
plot(t3, title="T3", color=#741b47, linewidth=2, transp=0)