예제 #1
0
func fetchLatest(api *stocks.API, symbols ...string) {
	// Run through each actively tracked stock and calculate stopping prices, notify next of kin, what have you...
	log.Printf("%d stocks tracked.\n", len(symbols))

	for _, symbol := range symbols {
		// Record trading history:
		log.Printf("%s: recording historical data and calculating statistics...\n", symbol)
		api.RecordHistory(symbol)
	}

	// Fetch current prices from Yahoo into the database:
	log.Printf("Fetching current prices...\n")
	api.GetCurrentHourlyPrices(true, symbols...)
}