I suspect these two:
MaxValue = MaxValue + "0,05"
MinValue = MaxValue - "0,1"
need to be
MaxValue = MaxValue + 0.05
MinValue = MaxValue - 0.1