Improve portfolio tool

This commit is contained in:
Adrian Gallagher
2017-05-21 13:17:20 +10:00
parent 77ca9cc2b7
commit 3c53fe9419

View File

@@ -70,6 +70,11 @@ func main() {
pf.Subtotal = 0
bf := bitfinex.Bitfinex{}
if currency.IsDefaultCurrency(x) {
continue
}
ticker, err := bf.GetTicker(x+"USD", url.Values{})
if err != nil {
log.Println(err)
@@ -81,7 +86,7 @@ func main() {
}
for x, y := range stuff {
log.Printf("%s %f subtotal: %f USD. Percentage of portfolio %f", x, y.Balance, y.Subtotal, y.Subtotal/total*100/1)
log.Printf("%s %f subtotal: %f USD (1 %s = %.2f USD). Percentage of portfolio %f", x, y.Balance, y.Subtotal, x, y.Subtotal/y.Balance, y.Subtotal/total*100/1)
}
log.Printf("Total balance in USD: %f.\n", total)