From c08899f7fb4847a8dc94b3b8109b2d95d0e3e5e6 Mon Sep 17 00:00:00 2001 From: ycdesu Date: Mon, 15 Mar 2021 18:51:29 +0800 Subject: [PATCH 1/3] ftx: add ftx to supported exchange --- pkg/bbgo/trader.go | 5 ++--- pkg/cmd/balances.go | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/bbgo/trader.go b/pkg/bbgo/trader.go index 9ad1c1a81..64b1891c4 100644 --- a/pkg/bbgo/trader.go +++ b/pkg/bbgo/trader.go @@ -14,7 +14,7 @@ import ( _ "github.com/go-sql-driver/mysql" ) -var SupportedExchanges = []types.ExchangeName{"binance", "max"} +var SupportedExchanges = []types.ExchangeName{"binance", "max", "ftx"} // SingleExchangeStrategy represents the single Exchange strategy type SingleExchangeStrategy interface { @@ -103,7 +103,7 @@ func (trader *Trader) Configure(userConfig *Config) error { for _, entry := range userConfig.ExchangeStrategies { for _, mount := range entry.Mounts { log.Infof("attaching strategy %T on %s...", entry.Strategy, mount) - if err := trader.AttachStrategyOn(mount, entry.Strategy) ; err != nil { + if err := trader.AttachStrategyOn(mount, entry.Strategy); err != nil { return err } } @@ -131,7 +131,6 @@ func (trader *Trader) Configure(userConfig *Config) error { return nil } - // AttachStrategyOn attaches the single exchange strategy on an exchange Session. // Single exchange strategy is the default behavior. func (trader *Trader) AttachStrategyOn(session string, strategies ...SingleExchangeStrategy) error { diff --git a/pkg/cmd/balances.go b/pkg/cmd/balances.go index 27c011490..f6d0335f6 100644 --- a/pkg/cmd/balances.go +++ b/pkg/cmd/balances.go @@ -42,9 +42,8 @@ var balancesCmd = &cobra.Command{ return err } - environ := bbgo.NewEnvironment() - if err := environ.ConfigureDatabase(ctx) ; err != nil { + if err := environ.ConfigureDatabase(ctx); err != nil { return err } @@ -71,4 +70,3 @@ var balancesCmd = &cobra.Command{ return nil }, } - From 8fd182672c59fce3f89a8a029530a9279593c17c Mon Sep 17 00:00:00 2001 From: ycdesu Date: Mon, 15 Mar 2021 18:52:31 +0800 Subject: [PATCH 2/3] doc: modify subaccount key --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c61911f0b..fdd31c096 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ MAX_API_SECRET= FTX_API_KEY= FTX_API_SECRET= # specify it if credentials are for subaccount -FTX_SUBACCOUNT_NAME= +FTX_SUBACCOUNT= MYSQL_URL=root@tcp(127.0.0.1:3306)/bbgo?parseTime=true ``` From 4672f0b7bc397ebc49a0ec680f28ea6b41ed377d Mon Sep 17 00:00:00 2001 From: ycdesu Date: Mon, 15 Mar 2021 20:42:53 +0800 Subject: [PATCH 3/3] doc: show how to generate bbgo.yaml in the beginning of readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index fdd31c096..2ced5ab88 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,12 @@ MYSQL_URL=root@tcp(127.0.0.1:3306)/bbgo?parseTime=true Prepare your dotenv file `.env.local` and BBGO yaml config file `bbgo.yaml`. +The minimal bbgo.yaml could be generated by: +```shell +mkdir config +(cd config && curl -o bbgo.yaml https://raw.githubusercontent.com/c9s/bbgo/main/config/minimal.yaml) +``` + To sync your own trade data: ```