Moving Average 3.0 (3rd Generation) script.
This indicator was originally developed and described by Dr. Manfred G. Dürschner in his paper “Gleitende Durchschnitte 3.0”.
corta = 7
lunga = 21
matype = 0
// -------------
length1 = corta
length2 = lunga
mediatrezero = matype // https://www.prorealcode.com/documentation/average/
src = CustomClose
//
lambda = length1 / length2
alpha = lambda * (length1 - 1) / (length1 - lambda)
//
ma1 = average[length1,matype](src)
ma2 = average[length2,matype](ma1)
nma = (1 + alpha) * ma1 - alpha * ma2
//
RETURN nma AS "Moving Average 3.0"