The measurement of hydraulic cylinder displacement has been addressed from different fields. The detection principle of magnetic grating is able to realize the high integration and accuracy. In this paper, a signal response quality evaluation algorithm for devising and optimizing a high-accuracy displacement measuring system is proposed. On the basic of signal response quality evaluation method, structure variables are optimized to enhance the working performance. By defining the parameters, an optimum structure cylinder prototype is made and tested to provide better estimates. Experimental results on working characteristic are presented to verify the effectiveness of the optimized structure. The efficiency of the proposed signal response quality evaluation function is therefore demonstrated through the working performance.