calculating and plotting sliding ratio