mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 16:55:15 +00:00
Merge pull request #158 from c9s/minor/ftx-configs
This commit is contained in:
commit
2c660b716a
|
@ -67,13 +67,19 @@ 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
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
```
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user