mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
154 lines
4.3 KiB
YAML
154 lines
4.3 KiB
YAML
---
|
|
persistence:
|
|
redis:
|
|
host: 127.0.0.1
|
|
port: 6379
|
|
db: 0
|
|
|
|
sessions:
|
|
binance:
|
|
exchange: binance
|
|
envVarPrefix: binance
|
|
margin: true
|
|
isolatedMargin: true
|
|
isolatedMarginSymbol: BTCUSDT
|
|
|
|
backtest:
|
|
sessions: [binance]
|
|
# 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: "2022-05-01"
|
|
endTime: "2022-10-31"
|
|
symbols:
|
|
- BTCUSDT
|
|
accounts:
|
|
binance:
|
|
makerCommission: 10 # 0.15%
|
|
takerCommission: 15 # 0.15%
|
|
balances:
|
|
BTC: 2.0
|
|
USDT: 10000.0
|
|
|
|
exchangeStrategies:
|
|
- on: binance
|
|
linregmaker:
|
|
symbol: BTCUSDT
|
|
|
|
# interval is how long do you want to update your order price and quantity
|
|
interval: 1m
|
|
|
|
leverage: 1
|
|
|
|
# reverseEMA
|
|
reverseEMA:
|
|
interval: 1d
|
|
window: 60
|
|
|
|
# reverseInterval
|
|
reverseInterval: 4h
|
|
|
|
# fastLinReg
|
|
fastLinReg:
|
|
interval: 1m
|
|
window: 30
|
|
|
|
# slowLinReg
|
|
slowLinReg:
|
|
interval: 1m
|
|
window: 120
|
|
|
|
# allowOppositePosition
|
|
allowOppositePosition: true
|
|
|
|
# fasterDecreaseRatio
|
|
fasterDecreaseRatio: 2
|
|
|
|
# neutralBollinger
|
|
neutralBollinger:
|
|
interval: "15m"
|
|
window: 21
|
|
bandWidth: 2.0
|
|
|
|
# tradeInBand: when tradeInBand is set, you will only place orders in the bollinger band.
|
|
tradeInBand: true
|
|
|
|
# spread
|
|
spread: 0.1%
|
|
# dynamicSpread
|
|
dynamicSpread:
|
|
amplitude: # delete other scaling strategy if this is defined
|
|
# window is the window of the SMAs of spreads
|
|
window: 1
|
|
interval: "1m"
|
|
askSpreadScale:
|
|
byPercentage:
|
|
# exp means we want to use exponential scale, you can replace "exp" with "linear" for linear scale
|
|
exp:
|
|
# from down to up
|
|
domain: [ 0.0001, 0.005 ]
|
|
# when in down band, holds 1.0 by maximum
|
|
# when in up band, holds 0.05 by maximum
|
|
range: [ 0.001, 0.002 ]
|
|
bidSpreadScale:
|
|
byPercentage:
|
|
# exp means we want to use exponential scale, you can replace "exp" with "linear" for linear scale
|
|
exp:
|
|
# from down to up
|
|
domain: [ 0.0001, 0.005 ]
|
|
# when in down band, holds 1.0 by maximum
|
|
# when in up band, holds 0.05 by maximum
|
|
range: [ 0.001, 0.002 ]
|
|
|
|
#maxExposurePosition: 10
|
|
DynamicExposure:
|
|
bollBandExposure:
|
|
interval: "1h"
|
|
window: 21
|
|
bandWidth: 2.0
|
|
dynamicExposurePositionScale:
|
|
byPercentage:
|
|
# exp means we want to use exponential scale, you can replace "exp" with "linear" for linear scale
|
|
exp:
|
|
# from lower band -100% (-1) to upper band 100% (+1)
|
|
domain: [ -1, 1 ]
|
|
# when in down band, holds 1.0 by maximum
|
|
# when in up band, holds 0.05 by maximum
|
|
range: [ 0.1, 10 ]
|
|
|
|
# quantity is the base order quantity for your buy/sell order.
|
|
quantity: 0.1
|
|
dynamicQuantityIncrease:
|
|
- linRegDynamicQuantity:
|
|
quantityLinReg:
|
|
interval: 1m
|
|
window: 20
|
|
dynamicQuantityLinRegScale:
|
|
byPercentage:
|
|
# log means we want to use log scale, you can replace "log" with "linear" for linear scale
|
|
linear:
|
|
# from lower band -100% (-1) to upper band 100% (+1)
|
|
domain: [ -0.000002, 0.000002 ]
|
|
# when in down band, holds 1.0 by maximum
|
|
# when in up band, holds 0.05 by maximum
|
|
range: [ 0, 0.001 ]
|
|
dynamicQuantityDecrease:
|
|
- linRegDynamicQuantity:
|
|
quantityLinReg:
|
|
interval: 1m
|
|
window: 20
|
|
dynamicQuantityLinRegScale:
|
|
byPercentage:
|
|
# log means we want to use log scale, you can replace "log" with "linear" for linear scale
|
|
linear:
|
|
# from lower band -100% (-1) to upper band 100% (+1)
|
|
domain: [0.000002, -0.000002 ]
|
|
# when in down band, holds 1.0 by maximum
|
|
# when in up band, holds 0.05 by maximum
|
|
range: [ 0, 0.001 ]
|
|
|
|
exits:
|
|
# roiStopLoss is the stop loss percentage of the position ROI (currently the price change)
|
|
- roiStopLoss:
|
|
percentage: 30%
|