Define read_stock_data function