Merge pull request #158 from c9s/minor/ftx-configs

This commit is contained in:
YC 2021-03-15 21:03:27 +08:00 committed by GitHub
commit 2c660b716a
3 changed files with 10 additions and 7 deletions

View File

@ -67,13 +67,19 @@ MAX_API_SECRET=
FTX_API_KEY= FTX_API_KEY=
FTX_API_SECRET= FTX_API_SECRET=
# specify it if credentials are for subaccount # specify it if credentials are for subaccount
FTX_SUBACCOUNT_NAME= FTX_SUBACCOUNT=
MYSQL_URL=root@tcp(127.0.0.1:3306)/bbgo?parseTime=true 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`. 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: To sync your own trade data:
``` ```

View File

@ -14,7 +14,7 @@ import (
_ "github.com/go-sql-driver/mysql" _ "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 // SingleExchangeStrategy represents the single Exchange strategy
type SingleExchangeStrategy interface { type SingleExchangeStrategy interface {
@ -131,7 +131,6 @@ func (trader *Trader) Configure(userConfig *Config) error {
return nil return nil
} }
// AttachStrategyOn attaches the single exchange strategy on an exchange Session. // AttachStrategyOn attaches the single exchange strategy on an exchange Session.
// Single exchange strategy is the default behavior. // Single exchange strategy is the default behavior.
func (trader *Trader) AttachStrategyOn(session string, strategies ...SingleExchangeStrategy) error { func (trader *Trader) AttachStrategyOn(session string, strategies ...SingleExchangeStrategy) error {

View File

@ -42,7 +42,6 @@ var balancesCmd = &cobra.Command{
return err return err
} }
environ := bbgo.NewEnvironment() environ := bbgo.NewEnvironment()
if err := environ.ConfigureDatabase(ctx); err != nil { if err := environ.ConfigureDatabase(ctx); err != nil {
return err return err
@ -71,4 +70,3 @@ var balancesCmd = &cobra.Command{
return nil return nil
}, },
} }