Geometrical Mean Moving Average
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ThiagoSchmitz

//@version=5
indicator("Geometrical Mean Moving Average", "GeoMMA", true)
float source = input.source(close, "Source")
int period = input.int(10, "Period")
float exponent = 1.0 / period
float sma = ta.sma(source, 1)
float multiple = 1.0
for i = 0 to period - 1 by 1
    multiple := multiple * sma[i]
float gmma = math.pow(multiple, exponent)
plot(gmma, "GMMA", color.yellow, 2)