mirror of
https://github.com/c9s/bbgo.git
synced 2024-09-20 08:11:08 +00:00
config: add grid2 config
This commit is contained in:
parent
e981ad641a
commit
e385b589b6
33
config/grid2.yaml
Normal file
33
config/grid2.yaml
Normal file
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
sessions:
|
||||
binance:
|
||||
exchange: binance
|
||||
envVarPrefix: binance
|
||||
max:
|
||||
exchange: max
|
||||
envVarPrefix: max
|
||||
|
||||
# example command:
|
||||
# godotenv -f .env.local -- go run ./cmd/bbgo backtest --sync-from 2020-11-01 --config config/grid.yaml --base-asset-baseline
|
||||
backtest:
|
||||
startTime: "2022-01-01"
|
||||
endTime: "2022-11-25"
|
||||
symbols:
|
||||
- BTCUSDT
|
||||
sessions: [max]
|
||||
accounts:
|
||||
binance:
|
||||
balances:
|
||||
BTC: 0.0
|
||||
USDT: 10000.0
|
||||
|
||||
exchangeStrategies:
|
||||
|
||||
- on: max
|
||||
grid2:
|
||||
symbol: BTCUSDT
|
||||
upperPrice: 10_000.0
|
||||
lowerPrice: 15_000.0
|
||||
gridNumber: 10
|
||||
quantity: 0.001
|
||||
# profitSpread: 1000.0 # The profit price spread that you want to add to your sell order when your buy order is executed
|
|
@ -337,6 +337,8 @@ func (s *Strategy) setupGridOrders(ctx context.Context, session *bbgo.ExchangeSe
|
|||
return err2
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// TODO: calculate the quantity from the investment configuration
|
||||
}
|
||||
|
||||
if !s.BaseInvestment.IsZero() && !s.QuoteInvestment.IsZero() {
|
||||
|
@ -420,7 +422,9 @@ func (s *Strategy) setupGridOrders(ctx context.Context, session *bbgo.ExchangeSe
|
|||
if err2 != nil {
|
||||
return err
|
||||
}
|
||||
_ = createdOrders
|
||||
for _, order := range createdOrders {
|
||||
log.Infof(order.String())
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user