Variable pricing cloud resources are the most recent advancement in cloud computing business models. Cloud vendors like Amazon Web Services, a.k.a. Amazon AWS provide a new cloud instance type known as 'Spot instance'. The distinguishing feature of spot instance is its dynamic pricing. The price of spot instances varies dynamically with time based on demand and supply of cloud resources in the data centers across the globe. Customers place bids to obtain spot instances using an online auction platform. The auction platform determines the market clearance price, a.k.a. 'Spot price' and the users whose bids are above the aforementioned price obtain the instances. Cloud vendors provide current and archived spot price data to assist their customers in bidding process. The major challenge for the customers in this new business model is to predict the spot price before placing their bids. In this paper, we have provided a novel algorithm for spot price prediction. We also have instantiated and demonstrated the proposed algorithm. The results show high accuracy of 9.4% Mean Absolute Percent Error (MAPE) for short term (one day ahead) and less 20% MAPE for long term (five days ahead) forecasting.