Stock data collection code