I dont know the exact formula but the bar period is divided in equal parts and the offset starts with the highest so that the last cycle has offset zero. Preload and testnow have nothing to do with that.