Last active
June 2, 2021 16:53
-
-
Save c9s/d53587559d84c2542833d6d3cc588f5d to your computer and use it in GitHub Desktop.
bbgo - support strategy with margin, isolated margin and spot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
notifications: | |
slack: | |
defaultChannel: "dev-bbgo" | |
errorChannel: "bbgo-error" | |
# if you want to route channel by symbol | |
symbolChannels: | |
"^BTC": "btc" | |
"^ETH": "eth" | |
"^BNB": "bnb" | |
# object routing rules | |
routing: | |
trade: "$symbol" | |
order: "$symbol" | |
submitOrder: "$session" # not supported yet | |
pnL: "bbgo-pnl" | |
sessions: | |
# binance spot account connection | |
binance: | |
exchange: binance | |
# binance cross margin connection | |
binance_margin: | |
exchange: binance | |
margin: true | |
# binance isolated margin connection for LTCUSDT | |
binance_margin_ltcusdt: | |
exchange: binance | |
margin: true | |
isolatedMargin: true | |
isolatedMarginSymbol: LTCUSDT | |
# binance isolated margin connection for BTCUSDT | |
binance_margin_btcusdt: | |
exchange: binance | |
margin: true | |
isolatedMargin: true | |
isolatedMarginSymbol: BTCUSDT | |
# binance isolated margin connection for LINKUSDT | |
binance_margin_linkusdt: | |
exchange: binance | |
margin: true | |
isolatedMargin: true | |
isolatedMarginSymbol: LINKUSDT | |
# binance isolated margin connection for ETCUSDT | |
binance_margin_etcusdt: | |
exchange: binance | |
margin: true | |
isolatedMargin: true | |
isolatedMarginSymbol: ETCUSDT | |
# binance isolated margin connection for BCHUSDT | |
binance_margin_bchusdt: | |
exchange: binance | |
margin: true | |
isolatedMargin: true | |
isolatedMarginSymbol: BCHUSDT | |
# binance isolated margin connection for BNBUSDT | |
binance_margin_bnbusdt: | |
exchange: binance | |
margin: true | |
isolatedMargin: true | |
isolatedMarginSymbol: BNBUSDT | |
# binance isolated margin connection for ADAUSDT | |
binance_margin_adausdt: | |
exchange: binance | |
margin: true | |
isolatedMargin: true | |
isolatedMarginSymbol: ADAUSDT | |
# binance isolated margin connection for DOGEUSDT | |
binance_margin_dogeusdt: | |
exchange: binance | |
margin: true | |
isolatedMargin: true | |
isolatedMarginSymbol: DOGEUSDT | |
riskControls: | |
# This is the session-based risk controller, which let you configure different risk controller by session. | |
sessionBased: | |
# session name here | |
binance: | |
orderExecutor: | |
bySymbol: | |
BTCUSDT: | |
basic: | |
minQuoteBalance: 20 # 100 | |
maxBaseAssetBalance: 3.0 | |
minBaseAssetBalance: 0.0 | |
maxOrderAmount: 1000.0 | |
binance_margin_ltcusdt: | |
orderExecutor: | |
bySymbol: | |
BTCUSDT: | |
basic: | |
minQuoteBalance: 20 # 100 | |
maxBaseAssetBalance: 3.0 | |
minBaseAssetBalance: 0.0 | |
maxOrderAmount: 1000.0 | |
exchangeStrategies: | |
- on: binance_margin_linkusdt | |
support: | |
symbol: LINKUSDT | |
interval: 1m | |
minVolume: 1_000 | |
marginOrderSideEffect: borrow | |
scaleQuantity: | |
byVolume: | |
exp: | |
domain: [ 1_000, 200_000 ] | |
range: [ 0.05, 1.0 ] | |
maxBaseAssetBalance: 1000.0 | |
minQuoteAssetBalance: 20.0 | |
targets: | |
- profitPercentage: 0.02 | |
quantityPercentage: 0.5 | |
marginOrderSideEffect: repay | |
- on: binance_margin_ltcusdt | |
support: | |
symbol: LTCUSDT | |
interval: 1m | |
minVolume: 1_000 | |
marginOrderSideEffect: borrow | |
scaleQuantity: | |
byVolume: | |
exp: | |
domain: [ 1_000, 200_000 ] | |
range: [ 0.05, 1.0 ] | |
maxBaseAssetBalance: 1000.0 | |
minQuoteAssetBalance: 20.0 | |
targets: | |
- profitPercentage: 0.02 | |
quantityPercentage: 0.5 | |
marginOrderSideEffect: repay | |
- on: binance_margin_etcusdt | |
support: | |
symbol: ETCUSDT | |
interval: 1m | |
minVolume: 1_000 | |
marginOrderSideEffect: borrow | |
scaleQuantity: | |
byVolume: | |
exp: | |
domain: [ 1_000, 200_000 ] | |
range: [ 0.5, 1.0 ] | |
maxBaseAssetBalance: 1000.0 | |
minQuoteAssetBalance: 20.0 | |
targets: | |
- profitPercentage: 0.02 | |
quantityPercentage: 0.5 | |
marginOrderSideEffect: repay | |
- on: binance_margin_bchusdt | |
support: | |
symbol: BCHUSDT | |
interval: 1m | |
minVolume: 1_000 | |
marginOrderSideEffect: borrow | |
scaleQuantity: | |
byVolume: | |
exp: | |
domain: [ 1_000, 200_000 ] | |
range: [ 0.5, 1.0 ] | |
maxBaseAssetBalance: 1000.0 # 1000.0 | |
minQuoteAssetBalance: 20.0 # 2000.0 | |
targets: | |
- profitPercentage: 0.02 | |
quantityPercentage: 0.5 | |
marginOrderSideEffect: repay | |
- on: binance_margin_bnbusdt | |
support: | |
symbol: BNBUSDT | |
interval: 1m | |
minVolume: 1_000 | |
marginOrderSideEffect: borrow | |
scaleQuantity: | |
byVolume: | |
exp: | |
domain: [ 1_000, 200_000 ] | |
range: [ 0.06, 1.0 ] | |
maxBaseAssetBalance: 1000.0 | |
minQuoteAssetBalance: 20.0 | |
targets: | |
- profitPercentage: 0.02 | |
quantityPercentage: 0.5 | |
marginOrderSideEffect: repay | |
- on: binance_margin_adausdt | |
support: | |
symbol: ADAUSDT | |
interval: 1m | |
minVolume: 1_000 | |
marginOrderSideEffect: borrow | |
scaleQuantity: | |
byVolume: | |
exp: | |
domain: [ 1_000, 200_000 ] | |
range: [ 0.06, 1.0 ] | |
maxBaseAssetBalance: 1000.0 # 1000.0 | |
minQuoteAssetBalance: 20.0 # 2000.0 | |
targets: | |
- profitPercentage: 0.02 | |
quantityPercentage: 0.5 | |
marginOrderSideEffect: repay | |
- on: binance_margin_dogeusdt | |
support: | |
symbol: DOGEUSDT | |
interval: 1m | |
minVolume: 1_000 | |
marginOrderSideEffect: borrow | |
scaleQuantity: | |
byVolume: | |
exp: | |
domain: [ 1_000, 200_000 ] | |
range: [ 0.5, 1.0 ] | |
maxBaseAssetBalance: 1000.0 | |
minQuoteAssetBalance: 20.0 | |
targets: | |
- profitPercentage: 0.02 | |
quantityPercentage: 0.5 | |
marginOrderSideEffect: repay |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment