Averaging function. To avoid putting the grid at the moment of the signal. And to average on the command of the indicator sending an additional signal to buy.