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 - OKEx Spot Exchange
- Kucoin Spot Exchange - Kucoin Spot Exchange
- MAX Spot Exchange (located in Taiwan) - MAX Spot Exchange (located in Taiwan)
- Bitget (In Progress) - Bitget Exchange (In Progress)
- Bybit Exchange (In Progress)
## Documentation and General Topics ## Documentation and General Topics
@ -219,6 +220,10 @@ KUCOIN_API_KEY=
KUCOIN_API_SECRET= KUCOIN_API_SECRET=
KUCOIN_API_PASSPHRASE= KUCOIN_API_PASSPHRASE=
KUCOIN_API_KEY_VERSION=2 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`. 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/binance"
"github.com/c9s/bbgo/pkg/exchange/bitget" "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/kucoin"
"github.com/c9s/bbgo/pkg/exchange/max" "github.com/c9s/bbgo/pkg/exchange/max"
"github.com/c9s/bbgo/pkg/exchange/okex" "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: case types.ExchangeBitget:
return bitget.New(key, secret, passphrase), nil return bitget.New(key, secret, passphrase), nil
case types.ExchangeBybit:
return bybit.New(key, secret)
default: default:
return nil, fmt.Errorf("unsupported exchange: %v", n) return nil, fmt.Errorf("unsupported exchange: %v", n)

View File

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