ATHOS: On-the-fly stellar parameter determination of FGK stars based on flux ratios from optical spectra