add basic risk control to the xmaker config

This commit is contained in:
c9s 2021-03-21 11:21:33 +08:00
parent bc620601f6
commit e22a2caade
2 changed files with 49 additions and 12 deletions

View File

@ -41,16 +41,39 @@ persistence:
sessions: sessions:
max: max:
exchange: max exchange: max
envVarPrefix: max envVarPrefix: MAX
binance: binance:
exchange: binance exchange: binance
envVarPrefix: binance envVarPrefix: BINANCE
riskControls:
# This is the session-based risk controller, which let you configure different risk controller by session.
sessionBased:
# "max" is the session name that you want to configure the risk control
max:
# orderExecutor is one of the risk control
orderExecutor:
# symbol-routed order executor
bySymbol:
BTCUSDT:
# basic risk control order executor
basic:
# keep at least X USDT (keep cash)
minQuoteBalance: 100.0
# maximum BTC balance (don't buy too much)
maxBaseAssetBalance: 1.0
# minimum BTC balance (don't sell too much)
minBaseAssetBalance: 0.01
maxOrderAmount: 1000.0
crossExchangeStrategies: crossExchangeStrategies:
- mobydick: - mobydick:
symbol: "BTCUSDT" symbol: BTCUSDT
sourceExchange: binance sourceExchange: binance
makerExchange: max makerExchange: max
updateInterval: 1s updateInterval: 1s

View File

@ -21,15 +21,6 @@ notifications:
submitOrder: "$silent" submitOrder: "$silent"
pnL: "bbgo-pnl" pnL: "bbgo-pnl"
reportPnL:
- averageCostBySymbols:
- "BTCUSDT"
- "BNBUSDT"
of: binance
when:
- "@daily"
- "@hourly"
persistence: persistence:
json: json:
directory: var/data directory: var/data
@ -47,6 +38,29 @@ sessions:
exchange: binance exchange: binance
envVarPrefix: binance envVarPrefix: binance
riskControls:
# This is the session-based risk controller, which let you configure different risk controller by session.
sessionBased:
# "max" is the session name that you want to configure the risk control
max:
# orderExecutor is one of the risk control
orderExecutor:
# symbol-routed order executor
bySymbol:
ETHUSDT:
# basic risk control order executor
basic:
# keep at least X USDT (keep cash)
minQuoteBalance: 100.0
# maximum ETH balance (don't buy too much)
maxBaseAssetBalance: 10.0
# minimum ETH balance (don't sell too much)
minBaseAssetBalance: 0.0
maxOrderAmount: 1000.0
crossExchangeStrategies: crossExchangeStrategies:
- mobydick: - mobydick: