mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 16:21:09 +00:00
add ftx, okex to the public exchange factory for backtest
This commit is contained in:
parent
914b170204
commit
2223ef088c
|
@ -33,6 +33,8 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/c9s/bbgo/pkg/exchange/ftx"
|
||||
"github.com/c9s/bbgo/pkg/exchange/okex"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/c9s/bbgo/pkg/bbgo"
|
||||
|
@ -313,6 +315,10 @@ func newPublicExchange(sourceExchange types.ExchangeName) (types.Exchange, error
|
|||
return binance.New("", ""), nil
|
||||
case types.ExchangeMax:
|
||||
return max.New("", ""), nil
|
||||
case types.ExchangeFTX:
|
||||
return ftx.NewExchange("", "", ""), nil
|
||||
case types.ExchangeOKEx:
|
||||
return okex.New("", "", ""), nil
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("exchange %s is not supported", sourceExchange)
|
||||
|
|
|
@ -28,7 +28,10 @@ type Exchange struct {
|
|||
|
||||
func New(key, secret, passphrase string) *Exchange {
|
||||
client := okexapi.NewClient()
|
||||
client.Auth(key, secret, passphrase)
|
||||
|
||||
if len(key) > 0 && len(secret) > 0 {
|
||||
client.Auth(key, secret, passphrase)
|
||||
}
|
||||
|
||||
return &Exchange{
|
||||
key: key,
|
||||
|
|
Loading…
Reference in New Issue
Block a user