automatic position size calculator