Integral (Area)
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © layth7ussein

//@version=5
indicator("Integral")

len = input.int(14, 'Length')
lowest = ta.lowest(close, len)
sum = 0.
for i=0 to len-1
    sum := sum + close[i] - lowest
ma = ta.sma(sum, 14)

plot(sum, color=color.red)