Applying fuzzy logic to stock price prediction