The cold dark matter theory predicts triaxial dark matter haloes. The radial distribution of halo ellipticity depends on baryonic processes and the nature of dark matter particles (collisionless or collisional). Here we show that we can use lensing flexion ratios to measure the halo ellipticity as a function of radius. We introduce a weight function and study the relationship between the first- and second-order statistics of flexion ratios, both of which can be used to reduce the bias in the estimation of ellipticity. We perform numerical tests for our method, and demonstrate that it can reduce the bias and determine the halo ellipticity as a function of radius. We also point out that the minimum mean flexion ratio can be used to trace the centres of galaxy clusters.