Ejemplo n.º 1
0
func main() {
	fmt.Printf("welcome to gofinance %v.%v.%v\n", MAJ_VERSION, MIN_VERSION, MIC_VERSION)

	var src fquery.Source
	// s := yahoofinance.NewCvs()
	src = bloomberg.New()
	src = yahoofinance.NewYql()

	// symbols := []string{
	// 	"VEUR.AS",
	// 	"VJPN.AS",
	// 	"VHYL.AS",
	// 	"AAPL",
	// 	"APC.F",
	// 	"GSZ.PA",
	// 	"COFB.BR",
	// 	"BEFB.BR",
	// 	"GIMB.BR",
	// 	"ELI.BR",
	// 	"DELB.BR",
	// 	"BELG.BR",
	// 	"TNET.BR",
	// }

	symbols := []string{
		"VEUR.AS",
		"VFEM.AS",
		"BELG.BR",
		"UMI.BR",
		"SOLB.BR",
		"KBC.BR",
		"DIE.BR",
		"DL.BR",
		"BEKB.BR",
		"ACKB.BR",
		"ABI.BR",
		"EURUSD=X",
	}

	sqlitecache.VERBOSITY = 0
	bloomberg.VERBOSITY = 2

	cache, err := newCache(src)
	if err != nil {
		fmt.Printf("WARNING: could not initialize cache (%v), going to use pure source\n\t", err)
	} else {
		cache.SetQuoteExpiry(5 * time.Minute)
		defer cache.Close()
		src = cache
	}

	// divhist(src)
	// hist(src, symbols...)
	calc(src, symbols...)
}
Ejemplo n.º 2
0
func main() {
	fmt.Printf("welcome to gofinance %v.%v.%v\n", MAJ_VERSION, MIN_VERSION, MIC_VERSION)

	var src fquery.Source
	// s := yahoofinance.NewCvs()
	src = bloomberg.New()
	src = yahoofinance.NewYql()

	symbols := []string{
		"SWKS",
		"NVO",
		"T",
		"UNH",
		"SBUX",
		"ACN",
		"MAN",
		"VTI",
		"WHG",
	}

	sqlitecache.VERBOSITY = 0
	bloomberg.VERBOSITY = 2

	cache, err := newCache(src)
	if err != nil {
		fmt.Printf("WARNING: could not initialize cache (%v), going to use pure source\n\t", err)
	} else {
		cache.SetQuoteExpiry(5 * time.Minute)
		defer cache.Close()
		src = cache
	}

	// divhist(src)
	// hist(src, symbols...)
	calc(src, symbols...)
}