Stellar parameters of early-M dwarfs from ratios of spectral features at optical wavelengths