bbgo_origin/config/grid2.yaml

129 lines
4.4 KiB
YAML
Raw Normal View History

2022-11-26 16:19:59 +00:00
---
notifications:
slack:
defaultChannel: "dev-bbgo"
errorChannel: "bbgo-error"
switches:
trade: false
orderUpdate: false
submitOrder: false
2022-11-26 16:19:59 +00:00
sessions:
binance:
exchange: binance
envVarPrefix: binance
2022-12-19 11:00:52 +00:00
sync:
# userDataStream is used to sync the trading data in real-time
# it uses the websocket connection to insert the trades
userDataStream:
trades: false
filledOrders: false
# since is the start date of your trading data
since: 2019-01-01
# sessions is the list of session names you want to sync
# by default, BBGO sync all your available sessions.
sessions:
- binance
# symbols is the list of symbols you want to sync
# by default, BBGO try to guess your symbols by your existing account balances.
symbols:
- BTCUSDT
2022-11-26 16:19:59 +00:00
# example command:
2022-12-03 03:16:29 +00:00
# go run ./cmd/bbgo backtest --config config/grid2.yaml --base-asset-baseline
2022-11-26 16:19:59 +00:00
backtest:
startTime: "2021-06-01"
endTime: "2021-06-30"
2022-11-26 16:19:59 +00:00
symbols:
- BTCUSDT
2022-12-03 03:16:29 +00:00
sessions: [binance]
2022-12-06 02:05:43 +00:00
feeMode: token
2022-11-26 16:19:59 +00:00
accounts:
binance:
makerFeeRate: 0.075%
takerFeeRate: 0.075%
2022-11-26 16:19:59 +00:00
balances:
2022-12-06 02:08:34 +00:00
BTC: 1.0
USDT: 21_000.0
2022-11-26 16:19:59 +00:00
exchangeStrategies:
2022-12-03 03:16:29 +00:00
- on: binance
2022-11-26 16:19:59 +00:00
grid2:
symbol: BTCUSDT
2022-12-25 17:00:15 +00:00
## autoRange can be used to detect a price range from a specific time frame
## the pivot low / pivot high of the given range will be used for lowerPrice and upperPrice.
## when autoRange is set, it will override the upperPrice/lowerPrice settings.
##
## the valid format is [1-9][hdw]
## example: "14d" means it will find the highest/lowest price that is higher/lower than left 14d and right 14d.
# autoRange: 14d
lowerPrice: 28_000.0
2022-12-06 02:47:19 +00:00
upperPrice: 50_000.0
## gridNumber is the total orders between the upper price and the lower price
## gridSpread = (upperPrice - lowerPrice) / gridNumber
## Make sure your gridNumber satisfy this: MIN(gridSpread/lowerPrice, gridSpread/upperPrice) > (makerFeeRate * 2)
gridNumber: 150
2022-12-02 05:46:09 +00:00
2022-12-03 08:49:46 +00:00
## compound is used for buying more inventory when the profit is made by the filled SELL order.
## when compound is disabled, fixed quantity is used for each grid order.
## default: false
2022-12-03 07:22:15 +00:00
compound: true
2022-12-03 08:49:46 +00:00
## earnBase is used to profit base quantity instead of quote quantity.
## meaning that earn BTC instead of USDT when trading in the BTCUSDT pair.
# earnBase: true
2022-12-03 08:52:58 +00:00
## triggerPrice (optional) is used for opening your grid only when the last price touches your trigger price.
2022-12-04 09:58:32 +00:00
## this is useful when you don't want to create a grid from a higher price.
## for example, when the last price hit 17_000.0 then open a grid with the price range 13_000 to 20_000
# triggerPrice: 17_000.0
2022-12-04 10:01:58 +00:00
## triggerPrice (optional) is used for closing your grid only when the last price touches your stop loss price.
2022-12-04 10:12:01 +00:00
## for example, when the price drops to 17_000.0 then close the grid and sell all base inventory.
# stopLossPrice: 10_000.0
2022-12-02 05:46:09 +00:00
## profitSpread is the profit spread of the arbitrage order (sell order)
## greater the profitSpread, greater the profit you make when the sell order is filled.
## you can set this instead of the default grid profit spread.
## by default, profitSpread = (upperPrice - lowerPrice) / gridNumber
## that is, greater the gridNumber, lesser the profit of each grid.
# profitSpread: 1000.0
## There are 3 kinds of setup
## NOTICE: you can only choose one, uncomment the config to enable it
##
## 1) fixed amount: amount is the quote unit (e.g. USDT in BTCUSDT)
# amount: 10.0
## 2) fixed quantity: it will use your balance to place orders with the fixed quantity. e.g. 0.001 BTC
# quantity: 0.001
## 3) quoteInvestment and baseInvestment: when using quoteInvestment, the strategy will automatically calculate your best quantity for the whole grid.
## quoteInvestment is required, and baseInvestment is optional (could be zero)
## if you have existing BTC position and want to reuse it you can set the baseInvestment.
quoteInvestment: 20_000
2022-12-05 11:46:48 +00:00
## baseInvestment (optional) can be useful when you have existing inventory, maybe bought at much lower price
2022-12-06 02:08:34 +00:00
baseInvestment: 1.0
2022-12-05 11:46:48 +00:00
## closeWhenCancelOrder (optional)
## default to false
2022-12-05 11:46:48 +00:00
closeWhenCancelOrder: true
## resetPositionWhenStart (optional)
## default to false
2022-12-05 11:46:48 +00:00
resetPositionWhenStart: false
## clearOpenOrdersWhenStart (optional)
## default to false
2022-12-05 11:46:48 +00:00
clearOpenOrdersWhenStart: false
keepOrdersWhenShutdown: false