This work proposes a new real-time cycle counting method for Battery Energy Storage Systems. Through some approximations, limits of the Rainflow Counting Algorithm (RCA) are overcame. The optimization study has been modeled as Mixed Integer Linear Programming and implemented in GAMS using CPLEX as solver. The comparison with the results obtained by applying the RCA is encouraging: the count faithfully reflects that obtained through RCA, and degradation estimation is close to the real value, with relative error below 3%.