A long in-plane beam polarization can be a desired feature for spin measurement experiments in storage rings. The spin precession of the particles within a beam can be controlled by means of the frozen spin method and beam bunching via RF cavities, eventually yielding a polarization lifetime of 10–100 s. Previous studies have shown that it can be further improved by sextupoles, which correct the second order effects related to the chromaticity of the beam. However, sextupoles can require readjustment after slight changes in ring parameters. This work presents a real-time sextupole tuning method that relies on a feedback algorithm. It adjusts the sextupole strength during storage, targeting a zero average radial spin component. Satisfying this condition results in a longer polarization lifetime. Simulation studies show that roughly determined feedback coefficients in this method work effectively for a wide range of ring parameters, with practical field imperfections and measurement errors taken into account. Alternatively, this technique can be used to optimize sextupole strengths in a test run without intervening the measurement.