pkg, types: add bybit to factor and update readme

This commit is contained in:
Edwin 2023-07-21 14:59:37 +08:00
parent b45fdea99a
commit ac5e2cf712
3 changed files with 12 additions and 1 deletions

View File

@ -128,7 +128,8 @@ the implementation.
- OKEx Spot Exchange
- Kucoin Spot Exchange
- MAX Spot Exchange (located in Taiwan)
- Bitget (In Progress)
- Bitget Exchange (In Progress)
- Bybit Exchange (In Progress)
## Documentation and General Topics
@ -219,6 +220,10 @@ KUCOIN_API_KEY=
KUCOIN_API_SECRET=
KUCOIN_API_PASSPHRASE=
KUCOIN_API_KEY_VERSION=2
# for Bybit exchange, if you have one
BYBIT_API_KEY=
BYBIT_API_SECRET=
```
Prepare your dotenv file `.env.local` and BBGO yaml config file `bbgo.yaml`.

View File

@ -7,6 +7,7 @@ import (
"github.com/c9s/bbgo/pkg/exchange/binance"
"github.com/c9s/bbgo/pkg/exchange/bitget"
"github.com/c9s/bbgo/pkg/exchange/bybit"
"github.com/c9s/bbgo/pkg/exchange/kucoin"
"github.com/c9s/bbgo/pkg/exchange/max"
"github.com/c9s/bbgo/pkg/exchange/okex"
@ -44,6 +45,9 @@ func New(n types.ExchangeName, key, secret, passphrase string) (types.ExchangeMi
case types.ExchangeBitget:
return bitget.New(key, secret, passphrase), nil
case types.ExchangeBybit:
return bybit.New(key, secret)
default:
return nil, fmt.Errorf("unsupported exchange: %v", n)

View File

@ -46,6 +46,7 @@ const (
ExchangeKucoin ExchangeName = "kucoin"
ExchangeBitget ExchangeName = "bitget"
ExchangeBacktest ExchangeName = "backtest"
ExchangeBybit ExchangeName = "bybit"
)
var SupportedExchanges = []ExchangeName{
@ -54,6 +55,7 @@ var SupportedExchanges = []ExchangeName{
ExchangeOKEx,
ExchangeKucoin,
ExchangeBitget,
ExchangeBybit,
// note: we are not using "backtest"
}