2021-10-14 04:53:23 +00:00
|
|
|
---
|
2021-10-17 16:57:23 +00:00
|
|
|
persistence:
|
|
|
|
redis:
|
|
|
|
host: 127.0.0.1
|
|
|
|
port: 6379
|
|
|
|
db: 0
|
2022-01-07 18:40:34 +00:00
|
|
|
|
|
|
|
# example command:
|
|
|
|
# godotenv -f .env.local -- go run ./cmd/bbgo backtest --exchange max --sync-from 2020-11-01 --config config/grid.yaml --base-asset-baseline
|
|
|
|
backtest:
|
|
|
|
# for testing max draw down (MDD) at 03-12
|
|
|
|
# see here for more details
|
|
|
|
# https://www.investopedia.com/terms/m/maximum-drawdown-mdd.asp
|
|
|
|
startTime: "2021-08-01"
|
2022-01-09 14:49:54 +00:00
|
|
|
endTime: "2021-08-30"
|
2022-01-07 18:40:34 +00:00
|
|
|
symbols:
|
|
|
|
- ETHUSDT
|
|
|
|
account:
|
|
|
|
balances:
|
|
|
|
ETH: 1.0
|
|
|
|
USDT: 20_000.0
|
|
|
|
|
2021-10-14 04:53:23 +00:00
|
|
|
exchangeStrategies:
|
|
|
|
|
2022-01-09 14:49:54 +00:00
|
|
|
- on: binance
|
2022-01-08 17:20:47 +00:00
|
|
|
bollmaker:
|
2021-10-17 16:42:01 +00:00
|
|
|
symbol: ETHUSDT
|
|
|
|
|
2022-01-09 14:48:34 +00:00
|
|
|
# interval is how long do you want to update your order price and quantity
|
|
|
|
interval: 1m
|
|
|
|
|
|
|
|
# quantity is the base order quantity for your buy/sell order.
|
|
|
|
quantity: 0.05
|
|
|
|
|
|
|
|
# useTickerPrice use the ticker api to get the mid price instead of the closed kline price.
|
|
|
|
# The back-test engine is kline-based, so the ticker price api is not supported.
|
|
|
|
# Turn this on if you want to do real trading.
|
|
|
|
useTickerPrice: false
|
|
|
|
|
|
|
|
# spread is the price spread from the middle price.
|
|
|
|
# For ask orders, the ask price is ((bestAsk + bestBid) / 2 * (1.0 + spread))
|
|
|
|
# For bid orders, the bid price is ((bestAsk + bestBid) / 2 * (1.0 - spread))
|
|
|
|
# Spread can be set by percentage or floating number. e.g., 0.1% or 0.001
|
|
|
|
spread: 0.1%
|
|
|
|
|
|
|
|
# minProfitSpread is the minimal order price spread from the current average cost.
|
|
|
|
# For long position, you will only place sell order above the price (= average cost * (1 + minProfitSpread))
|
|
|
|
# For short position, you will only place buy order below the price (= average cost * (1 - minProfitSpread))
|
2022-01-07 18:40:34 +00:00
|
|
|
minProfitSpread: 0.1%
|
|
|
|
|
2022-01-09 14:48:34 +00:00
|
|
|
# maxExposurePosition is the maximum position you can hold
|
|
|
|
# +10 means you can hold 10 ETH long position by maximum
|
|
|
|
# -10 means you can hold -10 ETH short position by maximum
|
|
|
|
# maxExposurePosition: 3.0
|
|
|
|
maxExposurePosition: 10
|
|
|
|
|
2022-01-27 00:52:27 +00:00
|
|
|
# dynamicExposurePositionScale overrides maxExposurePosition
|
|
|
|
# for domain,
|
|
|
|
# -1 means -100%, the price is on the lower band price.
|
|
|
|
# if the price breaks the lower band, a number less than -1 will be given.
|
|
|
|
# 1 means 100%, the price is on the upper band price.
|
|
|
|
# if the price breaks the upper band, a number greater than 1 will be given, for example, 1.2 for 120%, and 1.3 for 130%.
|
|
|
|
dynamicExposurePositionScale:
|
|
|
|
byPercentage:
|
|
|
|
# exp means we want to use exponential scale, you can replace "exp" with "linear" for linear scale
|
|
|
|
exp:
|
|
|
|
# from down to up
|
|
|
|
domain: [ -1, 1 ]
|
|
|
|
# when in down band, holds 1.0 by maximum
|
|
|
|
# when in up band, holds 0.05 by maximum
|
|
|
|
range: [ 1.0, 0.05 ]
|
|
|
|
|
2022-01-09 14:53:35 +00:00
|
|
|
# DisableShort means you can don't want short position during the market making
|
|
|
|
# THe short here means you might sell some of your existing inventory.
|
|
|
|
disableShort: true
|
|
|
|
|
2022-01-09 14:48:34 +00:00
|
|
|
# uptrendSkew, like the strongUptrendSkew, but the price is still in the default band.
|
|
|
|
uptrendSkew: 0.8
|
|
|
|
|
|
|
|
# downtrendSkew, like the strongDowntrendSkew, but the price is still in the default band.
|
|
|
|
downtrendSkew: 1.2
|
|
|
|
|
2021-10-17 16:42:01 +00:00
|
|
|
defaultBollinger:
|
2022-01-27 11:17:00 +00:00
|
|
|
interval: "1h"
|
2021-10-17 16:42:01 +00:00
|
|
|
window: 21
|
|
|
|
bandWidth: 2.0
|
2022-01-09 14:48:34 +00:00
|
|
|
|
|
|
|
# neutralBollinger is the smaller range of the bollinger band
|
|
|
|
# If price is in this band, it usually means the price is oscillating.
|
2021-10-17 16:42:01 +00:00
|
|
|
neutralBollinger:
|
|
|
|
interval: "5m"
|
|
|
|
window: 21
|
2022-01-27 11:17:00 +00:00
|
|
|
bandWidth: 2.0
|
2021-10-14 04:53:23 +00:00
|
|
|
|
2022-01-09 15:45:33 +00:00
|
|
|
persistence:
|
|
|
|
type: redis
|