new function that saves the stock data locally