Moved ticker fetching from main into the relative exchange.

This commit is contained in:
Adrian Gallagher
2015-03-18 16:36:01 +11:00
parent 8fdcb81924
commit b23070d7be
12 changed files with 260 additions and 215 deletions

View File

@@ -179,6 +179,24 @@ func (b *Bitfinex) SetAPIKeys(apiKey, apiSecret string) {
b.APISecret = apiSecret
}
func (b *Bitfinex) Run() {
b.GetAccountFeeInfo()
b.GetAccountBalance()
for b.Enabled {
go func() {
BitfinexLTC := b.GetTicker("ltcusd")
log.Printf("Bitfinex LTC: Last %f High %f Low %f Volume %f\n", BitfinexLTC.Last, BitfinexLTC.High, BitfinexLTC.Low, BitfinexLTC.Volume)
}()
go func() {
BitfinexBTC := b.GetTicker("btcusd")
log.Printf("Bitfinex BTC: Last %f High %f Low %f Volume %f\n", BitfinexBTC.Last, BitfinexBTC.High, BitfinexBTC.Low, BitfinexBTC.Volume)
}()
time.Sleep(time.Second * 10)
}
}
func (b *Bitfinex) GetFee(maker bool, symbol string) (float64, error) {
for _, i := range b.Fees {
if symbol == i.Currency {