Adding the first 5 values to compute offset

Thank you. Not completly but at least it makes the mean of a number of point, then I need to get only one result to have my offset, but it's useful. Thanks