mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
Added Websocket config variable.
This commit is contained in:
@@ -145,6 +145,7 @@ type Bitfinex struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Verbose bool
|
||||
Websocket bool
|
||||
PollingDelay time.Duration
|
||||
APIKey, APISecret string
|
||||
Ticker BitfinexTicker
|
||||
@@ -161,6 +162,7 @@ func (b *Bitfinex) SetDefaults() {
|
||||
b.Name = "Bitfinex"
|
||||
b.Enabled = true
|
||||
b.Verbose = false
|
||||
b.Websocket = false
|
||||
b.PollingDelay = 10
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ type Bitstamp struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Verbose bool
|
||||
Websocket bool
|
||||
PollingDelay time.Duration
|
||||
ClientID, APIKey, APISecret string
|
||||
Ticker BitstampTicker
|
||||
@@ -85,6 +86,7 @@ func (b *Bitstamp) SetDefaults() {
|
||||
b.Name = "Bitstamp"
|
||||
b.Enabled = true
|
||||
b.Verbose = false
|
||||
b.Websocket = false
|
||||
b.PollingDelay = 10
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ type BTCChina struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Verbose bool
|
||||
Websocket bool
|
||||
PollingDelay time.Duration
|
||||
APISecret, APIKey string
|
||||
Fee float64
|
||||
@@ -172,6 +173,7 @@ func (b *BTCChina) SetDefaults() {
|
||||
b.Enabled = true
|
||||
b.Fee = 0
|
||||
b.Verbose = false
|
||||
b.Websocket = false
|
||||
b.PollingDelay = 10
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ type BTCE struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Verbose bool
|
||||
Websocket bool
|
||||
PollingDelay time.Duration
|
||||
APIKey, APISecret string
|
||||
Fee float64
|
||||
@@ -65,6 +66,7 @@ func (b *BTCE) SetDefaults() {
|
||||
b.Enabled = true
|
||||
b.Fee = 0.2
|
||||
b.Verbose = false
|
||||
b.Websocket = false
|
||||
b.PollingDelay = 10
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ type BTCMarkets struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Verbose bool
|
||||
Websocket bool
|
||||
PollingDelay time.Duration
|
||||
Fee float64
|
||||
APIKey, APISecret string
|
||||
@@ -36,6 +37,7 @@ func (b *BTCMarkets) SetDefaults() {
|
||||
b.Enabled = true
|
||||
b.Fee = 0.85
|
||||
b.Verbose = false
|
||||
b.Websocket = false
|
||||
b.PollingDelay = 10
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ type Coinbase struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Verbose bool
|
||||
Websocket bool
|
||||
PollingDelay time.Duration
|
||||
Password, APIKey, APISecret string
|
||||
TakerFee, MakerFee float64
|
||||
@@ -89,6 +90,7 @@ func (c *Coinbase) SetDefaults() {
|
||||
c.TakerFee = 0.25
|
||||
c.MakerFee = 0
|
||||
c.Verbose = false
|
||||
c.Websocket = false
|
||||
c.PollingDelay = 10
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ type Exchanges struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Verbose bool
|
||||
Websocket bool
|
||||
PollingDelay time.Duration
|
||||
APIKey string
|
||||
APISecret string
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
"BaseCurrencies": "USD",
|
||||
"Enabled": true,
|
||||
"Verbose": false,
|
||||
"Websocket": false,
|
||||
"PollingDelay": 10
|
||||
},
|
||||
{
|
||||
@@ -29,6 +30,7 @@
|
||||
"BaseCurrencies": "USD",
|
||||
"Enabled": true,
|
||||
"Verbose": false,
|
||||
"Websocket": false,
|
||||
"PollingDelay": 10
|
||||
},
|
||||
{
|
||||
@@ -39,6 +41,7 @@
|
||||
"BaseCurrencies": "CNY",
|
||||
"Enabled": true,
|
||||
"Verbose": false,
|
||||
"Websocket": false,
|
||||
"PollingDelay": 10
|
||||
},
|
||||
{
|
||||
@@ -49,6 +52,7 @@
|
||||
"BaseCurrencies": "USD,RUB,EUR,CNY,GBP",
|
||||
"Enabled": true,
|
||||
"Verbose": false,
|
||||
"Websocket": false,
|
||||
"PollingDelay": 10
|
||||
},
|
||||
{
|
||||
@@ -59,6 +63,7 @@
|
||||
"BaseCurrencies": "AUD",
|
||||
"Enabled": true,
|
||||
"Verbose": false,
|
||||
"Websocket": false,
|
||||
"PollingDelay": 10
|
||||
},
|
||||
{
|
||||
@@ -70,6 +75,7 @@
|
||||
"BaseCurrencies": "USD",
|
||||
"Enabled": true,
|
||||
"Verbose": false,
|
||||
"Websocket": false,
|
||||
"PollingDelay": 10
|
||||
},
|
||||
{
|
||||
@@ -81,6 +87,7 @@
|
||||
"BaseCurrencies": "USD",
|
||||
"Enabled": true,
|
||||
"Verbose": false,
|
||||
"Websocket": false,
|
||||
"PollingDelay": 10
|
||||
},
|
||||
{
|
||||
@@ -91,6 +98,7 @@
|
||||
"BaseCurrencies": "CNY",
|
||||
"Enabled": true,
|
||||
"Verbose": false,
|
||||
"Websocket": false,
|
||||
"PollingDelay": 10
|
||||
},
|
||||
{
|
||||
@@ -101,6 +109,7 @@
|
||||
"BaseCurrencies": "USD,SGD,EUR",
|
||||
"Enabled": true,
|
||||
"Verbose": false,
|
||||
"Websocket": false,
|
||||
"PollingDelay": 10
|
||||
},
|
||||
{
|
||||
@@ -111,6 +120,7 @@
|
||||
"BaseCurrencies": "EUR,USD,GBP,JPY",
|
||||
"Enabled": true,
|
||||
"Verbose": false,
|
||||
"Websocket": false,
|
||||
"PollingDelay": 10
|
||||
},
|
||||
{
|
||||
@@ -121,6 +131,7 @@
|
||||
"BaseCurrencies": "CNY",
|
||||
"Enabled": true,
|
||||
"Verbose": false,
|
||||
"Websocket": false,
|
||||
"PollingDelay": 10
|
||||
},
|
||||
{
|
||||
@@ -131,6 +142,7 @@
|
||||
"BaseCurrencies": "CNY",
|
||||
"Enabled": true,
|
||||
"Verbose": false,
|
||||
"Websocket": false,
|
||||
"PollingDelay": 10
|
||||
},
|
||||
{
|
||||
@@ -141,6 +153,7 @@
|
||||
"BaseCurrencies": "USD",
|
||||
"Enabled": true,
|
||||
"Verbose": false,
|
||||
"Websocket": false,
|
||||
"PollingDelay": 10
|
||||
}
|
||||
]
|
||||
|
||||
@@ -34,6 +34,7 @@ type Cryptsy struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Verbose bool
|
||||
Websocket bool
|
||||
PollingDelay time.Duration
|
||||
APIKey, APISecret string
|
||||
TakerFee, MakerFee float64
|
||||
@@ -127,6 +128,7 @@ func (c *Cryptsy) SetDefaults() {
|
||||
c.Name = "Cryptsy"
|
||||
c.Enabled = true
|
||||
c.Verbose = false
|
||||
c.Websocket = false
|
||||
c.TakerFee = 0.33
|
||||
c.MakerFee = 0.33
|
||||
c.Verbose = false
|
||||
|
||||
@@ -18,6 +18,7 @@ type HUOBI struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Verbose bool
|
||||
Websocket bool
|
||||
PollingDelay time.Duration
|
||||
AccessKey, SecretKey string
|
||||
Fee float64
|
||||
@@ -42,6 +43,7 @@ func (h *HUOBI) SetDefaults() {
|
||||
h.Enabled = true
|
||||
h.Fee = 0
|
||||
h.Verbose = false
|
||||
h.Websocket = false
|
||||
h.PollingDelay = 10
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ type ItBit struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Verbose bool
|
||||
Websocket bool
|
||||
PollingDelay time.Duration
|
||||
ClientKey, APISecret, UserID string
|
||||
MakerFee, TakerFee float64
|
||||
@@ -50,6 +51,7 @@ func (i *ItBit) SetDefaults() {
|
||||
i.MakerFee = -0.10
|
||||
i.TakerFee = 0.50
|
||||
i.Verbose = false
|
||||
i.Websocket = false
|
||||
i.PollingDelay = 10
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ type Kraken struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Verbose bool
|
||||
Websocket bool
|
||||
PollingDelay time.Duration
|
||||
ClientKey, APISecret string
|
||||
FiatFee, CryptoFee float64
|
||||
@@ -57,6 +58,7 @@ func (k *Kraken) SetDefaults() {
|
||||
k.FiatFee = 0.35
|
||||
k.CryptoFee = 0.10
|
||||
k.Verbose = false
|
||||
k.Websocket = false
|
||||
k.PollingDelay = 10
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ type LakeBTC struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Verbose bool
|
||||
Websocket bool
|
||||
PollingDelay time.Duration
|
||||
Email, APISecret string
|
||||
TakerFee, MakerFee float64
|
||||
@@ -53,6 +54,7 @@ func (l *LakeBTC) SetDefaults() {
|
||||
l.TakerFee = 0.2
|
||||
l.MakerFee = 0.15
|
||||
l.Verbose = false
|
||||
l.Websocket = false
|
||||
l.PollingDelay = 10
|
||||
}
|
||||
|
||||
|
||||
13
main.go
13
main.go
@@ -109,6 +109,7 @@ func main() {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.btcchina.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
bot.exchange.btcchina.PollingDelay = exch.PollingDelay
|
||||
bot.exchange.btcchina.Websocket = exch.Websocket
|
||||
go bot.exchange.btcchina.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
@@ -127,6 +128,7 @@ func main() {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.bitstamp.SetAPIKeys(exch.ClientID, exch.APIKey, exch.APISecret)
|
||||
bot.exchange.bitstamp.PollingDelay = exch.PollingDelay
|
||||
bot.exchange.bitstamp.Websocket = exch.Websocket
|
||||
go bot.exchange.bitstamp.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
@@ -144,6 +146,7 @@ func main() {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.bitfinex.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
bot.exchange.bitfinex.PollingDelay = exch.PollingDelay
|
||||
bot.exchange.bitfinex.Websocket = exch.Websocket
|
||||
go bot.exchange.bitfinex.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
@@ -161,6 +164,7 @@ func main() {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.btce.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
bot.exchange.btce.PollingDelay = exch.PollingDelay
|
||||
bot.exchange.btce.Websocket = exch.Websocket
|
||||
go bot.exchange.btce.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
@@ -178,6 +182,7 @@ func main() {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.btcmarkets.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
bot.exchange.btcmarkets.PollingDelay = exch.PollingDelay
|
||||
bot.exchange.btcmarkets.Websocket = exch.Websocket
|
||||
go bot.exchange.btcmarkets.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
@@ -195,6 +200,7 @@ func main() {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.coinbase.SetAPIKeys(exch.ClientID, exch.APIKey, exch.APISecret)
|
||||
bot.exchange.coinbase.PollingDelay = exch.PollingDelay
|
||||
bot.exchange.coinbase.Websocket = exch.Websocket
|
||||
go bot.exchange.coinbase.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
@@ -212,6 +218,7 @@ func main() {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.cryptsy.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
bot.exchange.cryptsy.PollingDelay = exch.PollingDelay
|
||||
bot.exchange.cryptsy.Websocket = exch.Websocket
|
||||
go bot.exchange.cryptsy.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
@@ -229,6 +236,7 @@ func main() {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.okcoinChina.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
bot.exchange.okcoinChina.PollingDelay = exch.PollingDelay
|
||||
bot.exchange.okcoinChina.Websocket = exch.Websocket
|
||||
go bot.exchange.okcoinChina.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
@@ -246,6 +254,7 @@ func main() {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.okcoinIntl.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
bot.exchange.okcoinIntl.PollingDelay = exch.PollingDelay
|
||||
bot.exchange.okcoinIntl.Websocket = exch.Websocket
|
||||
go bot.exchange.okcoinIntl.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
@@ -263,6 +272,7 @@ func main() {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.itbit.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
bot.exchange.itbit.PollingDelay = exch.PollingDelay
|
||||
bot.exchange.itbit.Websocket = exch.Websocket
|
||||
go bot.exchange.itbit.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
@@ -280,6 +290,7 @@ func main() {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.kraken.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
bot.exchange.kraken.PollingDelay = exch.PollingDelay
|
||||
bot.exchange.kraken.Websocket = exch.Websocket
|
||||
go bot.exchange.kraken.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
@@ -297,6 +308,7 @@ func main() {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.lakebtc.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
bot.exchange.lakebtc.PollingDelay = exch.PollingDelay
|
||||
bot.exchange.lakebtc.Websocket = exch.Websocket
|
||||
go bot.exchange.lakebtc.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
@@ -314,6 +326,7 @@ func main() {
|
||||
log.Printf("%s enabled.\n", exch.Name)
|
||||
bot.exchange.huobi.SetAPIKeys(exch.APIKey, exch.APISecret)
|
||||
bot.exchange.huobi.PollingDelay = exch.PollingDelay
|
||||
bot.exchange.huobi.Websocket = exch.Websocket
|
||||
go bot.exchange.huobi.Run()
|
||||
|
||||
if exch.Verbose {
|
||||
|
||||
@@ -19,6 +19,7 @@ type OKCoin struct {
|
||||
Name string
|
||||
Enabled bool
|
||||
Verbose bool
|
||||
Websocket bool
|
||||
PollingDelay time.Duration
|
||||
APIUrl, PartnerID, SecretKey string
|
||||
TakerFee, MakerFee float64
|
||||
@@ -61,6 +62,7 @@ func (o *OKCoin) SetDefaults() {
|
||||
}
|
||||
o.Enabled = true
|
||||
o.Verbose = false
|
||||
o.Websocket = false
|
||||
o.PollingDelay = 10
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user