mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
config: optimize and update pivotshort config
Signed-off-by: c9s <yoanlin93@gmail.com>
This commit is contained in:
parent
37413e4355
commit
44d0bbc3fa
|
@ -1,100 +0,0 @@
|
||||||
---
|
|
||||||
sessions:
|
|
||||||
binance:
|
|
||||||
exchange: binance
|
|
||||||
envVarPrefix: binance
|
|
||||||
margin: true
|
|
||||||
# isolatedMargin: true
|
|
||||||
# isolatedMarginSymbol: ETHUSDT
|
|
||||||
|
|
||||||
exchangeStrategies:
|
|
||||||
- on: binance
|
|
||||||
pivotshort:
|
|
||||||
symbol: ETHUSDT
|
|
||||||
|
|
||||||
# interval is the main pivot interval
|
|
||||||
interval: 5m
|
|
||||||
|
|
||||||
# window is the main pivot window
|
|
||||||
window: 200
|
|
||||||
|
|
||||||
# breakLow settings are used for shorting when the current price break the previous low
|
|
||||||
breakLow:
|
|
||||||
# ratio is how much the price breaks the previous low to trigger the short.
|
|
||||||
ratio: -0.1%
|
|
||||||
|
|
||||||
# quantity is used for submitting the sell order
|
|
||||||
# if quantity is not set, all base balance will be used for selling the short.
|
|
||||||
quantity: 10.0
|
|
||||||
|
|
||||||
# marketOrder submits the market sell order when the closed price is lower than the previous pivot low.
|
|
||||||
marketOrder: true
|
|
||||||
|
|
||||||
# bounceRatio is used for calculating the price of the limit sell order.
|
|
||||||
# it's ratio of pivot low bounce when a new pivot low is detected.
|
|
||||||
# Sometimes when the price breaks the previous low, the price might be pulled back to a higher price.
|
|
||||||
# The bounceRatio is useful for such case, however, you might also miss the chance to short at the price if there is no pull back.
|
|
||||||
# Notice: When marketOrder is set, bounceRatio will not be used.
|
|
||||||
# bounceRatio: 0.1%
|
|
||||||
|
|
||||||
# stopEMARange is the price range we allow short.
|
|
||||||
# Short-allowed price range = [current price] > [EMA] * (1 - [stopEMARange])
|
|
||||||
stopEMARange: 0%
|
|
||||||
stopEMA:
|
|
||||||
interval: 1h
|
|
||||||
window: 99
|
|
||||||
|
|
||||||
bounceShort:
|
|
||||||
enabled: false
|
|
||||||
interval: 1h
|
|
||||||
window: 10
|
|
||||||
quantity: 10.0
|
|
||||||
minDistance: 3%
|
|
||||||
# stopLossPercentage: 1%
|
|
||||||
|
|
||||||
# ratio is the ratio of the resistance price,
|
|
||||||
# higher the ratio, lower the price
|
|
||||||
# first_layer_price = resistance_price * (1 - ratio)
|
|
||||||
# second_layer_price = (resistance_price * (1 - ratio)) * (2 * layerSpread)
|
|
||||||
ratio: 0%
|
|
||||||
numOfLayers: 1
|
|
||||||
layerSpread: 0.1%
|
|
||||||
|
|
||||||
exits:
|
|
||||||
# roiStopLoss is the stop loss percentage of the position ROI (currently the price change)
|
|
||||||
- roiStopLoss:
|
|
||||||
percentage: 2%
|
|
||||||
|
|
||||||
# roiTakeProfit is used to force taking profit by percentage of the position ROI (currently the price change)
|
|
||||||
# force to take the profit ROI exceeded the percentage.
|
|
||||||
- roiTakeProfit:
|
|
||||||
percentage: 30%
|
|
||||||
|
|
||||||
- protectionStopLoss:
|
|
||||||
activationRatio: 1%
|
|
||||||
stopLossRatio: 0.2%
|
|
||||||
placeStopOrder: true
|
|
||||||
|
|
||||||
# lowerShadowTakeProfit is used to taking profit when the (lower shadow height / low price) > lowerShadowRatio
|
|
||||||
# you can grab a simple stats by the following SQL:
|
|
||||||
# SELECT ((close - low) / close) AS shadow_ratio FROM binance_klines WHERE symbol = 'ETHUSDT' AND `interval` = '5m' AND start_time > '2022-01-01' ORDER BY shadow_ratio DESC LIMIT 20;
|
|
||||||
- lowerShadowTakeProfit:
|
|
||||||
ratio: 3%
|
|
||||||
|
|
||||||
# cumulatedVolumeTakeProfit is used to take profit when the cumulated quote volume from the klines exceeded a threshold
|
|
||||||
- cumulatedVolumeTakeProfit:
|
|
||||||
minQuoteVolume: 90_000_000
|
|
||||||
window: 5
|
|
||||||
|
|
||||||
backtest:
|
|
||||||
sessions:
|
|
||||||
- binance
|
|
||||||
startTime: "2022-04-01"
|
|
||||||
endTime: "2022-06-08"
|
|
||||||
symbols:
|
|
||||||
- ETHUSDT
|
|
||||||
accounts:
|
|
||||||
binance:
|
|
||||||
balances:
|
|
||||||
ETH: 10.0
|
|
||||||
USDT: 3000.0
|
|
|
@ -3,64 +3,105 @@ sessions:
|
||||||
binance:
|
binance:
|
||||||
exchange: binance
|
exchange: binance
|
||||||
envVarPrefix: binance
|
envVarPrefix: binance
|
||||||
# margin: true
|
margin: true
|
||||||
# isolatedMargin: true
|
# isolatedMargin: true
|
||||||
# isolatedMarginSymbol: GMTUSDT
|
# isolatedMarginSymbol: ETHUSDT
|
||||||
# futures: true
|
|
||||||
|
|
||||||
exchangeStrategies:
|
exchangeStrategies:
|
||||||
- on: binance
|
- on: binance
|
||||||
pivotshort:
|
pivotshort:
|
||||||
symbol: GMTUSDT
|
symbol: ETHUSDT
|
||||||
|
|
||||||
|
# interval is the main pivot interval
|
||||||
interval: 5m
|
interval: 5m
|
||||||
|
|
||||||
window: 120
|
# window is the main pivot window
|
||||||
|
window: 200
|
||||||
|
|
||||||
# breakLow settings are used for shorting when the current price break the previous low
|
# breakLow settings are used for shorting when the current price break the previous low
|
||||||
breakLow:
|
breakLow:
|
||||||
ratio: 0.1%
|
# ratio is how much the price breaks the previous low to trigger the short.
|
||||||
|
ratio: 0%
|
||||||
|
|
||||||
|
# quantity is used for submitting the sell order
|
||||||
|
# if quantity is not set, all base balance will be used for selling the short.
|
||||||
quantity: 10.0
|
quantity: 10.0
|
||||||
stopEMARange: 5%
|
|
||||||
|
# marketOrder submits the market sell order when the closed price is lower than the previous pivot low.
|
||||||
|
marketOrder: true
|
||||||
|
|
||||||
|
# bounceRatio is used for calculating the price of the limit sell order.
|
||||||
|
# it's ratio of pivot low bounce when a new pivot low is detected.
|
||||||
|
# Sometimes when the price breaks the previous low, the price might be pulled back to a higher price.
|
||||||
|
# The bounceRatio is useful for such case, however, you might also miss the chance to short at the price if there is no pull back.
|
||||||
|
# Notice: When marketOrder is set, bounceRatio will not be used.
|
||||||
|
# bounceRatio: 0.1%
|
||||||
|
|
||||||
|
# stopEMARange is the price range we allow short.
|
||||||
|
# Short-allowed price range = [current price] > [EMA] * (1 - [stopEMARange])
|
||||||
|
stopEMARange: 0%
|
||||||
stopEMA:
|
stopEMA:
|
||||||
interval: 1h
|
interval: 1h
|
||||||
window: 99
|
window: 99
|
||||||
|
|
||||||
exits:
|
bounceShort:
|
||||||
# roiStopLoss is the stop loss percentage of the position ROI (currently the price change)
|
enabled: false
|
||||||
- roiStopLoss:
|
interval: 1h
|
||||||
percentage: 2%
|
window: 10
|
||||||
|
quantity: 10.0
|
||||||
|
minDistance: 3%
|
||||||
|
# stopLossPercentage: 1%
|
||||||
|
|
||||||
# roiTakeProfit is used to force taking profit by percentage of the position ROI (currently the price change)
|
# ratio is the ratio of the resistance price,
|
||||||
|
# higher the ratio, lower the price
|
||||||
|
# first_layer_price = resistance_price * (1 - ratio)
|
||||||
|
# second_layer_price = (resistance_price * (1 - ratio)) * (2 * layerSpread)
|
||||||
|
ratio: 0%
|
||||||
|
numOfLayers: 1
|
||||||
|
layerSpread: 0.1%
|
||||||
|
|
||||||
|
exits:
|
||||||
|
# (0) roiStopLoss is the stop loss percentage of the position ROI (currently the price change)
|
||||||
|
- roiStopLoss:
|
||||||
|
percentage: 0.8%
|
||||||
|
|
||||||
|
# (1) roiTakeProfit is used to force taking profit by percentage of the position ROI (currently the price change)
|
||||||
# force to take the profit ROI exceeded the percentage.
|
# force to take the profit ROI exceeded the percentage.
|
||||||
- roiTakeProfit:
|
- roiTakeProfit:
|
||||||
percentage: 30%
|
percentage: 35%
|
||||||
|
|
||||||
|
# (2) protective stop loss -- short term
|
||||||
- protectionStopLoss:
|
- protectionStopLoss:
|
||||||
activationRatio: 1%
|
activationRatio: 0.6%
|
||||||
stopLossRatio: 0.2%
|
stopLossRatio: 0.1%
|
||||||
placeStopOrder: true
|
placeStopOrder: false
|
||||||
|
|
||||||
# lowerShadowTakeProfit is used to taking profit when the (lower shadow height / low price) > lowerShadowRatio
|
# (3) protective stop loss -- long term
|
||||||
|
- protectionStopLoss:
|
||||||
|
activationRatio: 5%
|
||||||
|
stopLossRatio: 1%
|
||||||
|
placeStopOrder: false
|
||||||
|
|
||||||
|
# (4) lowerShadowTakeProfit is used to taking profit when the (lower shadow height / low price) > lowerShadowRatio
|
||||||
# you can grab a simple stats by the following SQL:
|
# you can grab a simple stats by the following SQL:
|
||||||
#
|
|
||||||
# SELECT ((close - low) / close) AS shadow_ratio FROM binance_klines WHERE symbol = 'ETHUSDT' AND `interval` = '5m' AND start_time > '2022-01-01' ORDER BY shadow_ratio DESC LIMIT 20;
|
# SELECT ((close - low) / close) AS shadow_ratio FROM binance_klines WHERE symbol = 'ETHUSDT' AND `interval` = '5m' AND start_time > '2022-01-01' ORDER BY shadow_ratio DESC LIMIT 20;
|
||||||
- lowerShadowTakeProfit:
|
- lowerShadowTakeProfit:
|
||||||
ratio: 3%
|
ratio: 3%
|
||||||
|
|
||||||
# cumulatedVolumeTakeProfit is used to take profit when the cumulated quote volume from the klines exceeded a threshold
|
# (5) cumulatedVolumeTakeProfit is used to take profit when the cumulated quote volume from the klines exceeded a threshold
|
||||||
- cumulatedVolumeTakeProfit:
|
- cumulatedVolumeTakeProfit:
|
||||||
minQuoteVolume: 90_000_000
|
minQuoteVolume: 50_000_000
|
||||||
window: 5
|
window: 5
|
||||||
|
|
||||||
backtest:
|
backtest:
|
||||||
sessions:
|
sessions:
|
||||||
- binance
|
- binance
|
||||||
startTime: "2022-05-01"
|
startTime: "2022-04-01"
|
||||||
endTime: "2022-06-03"
|
endTime: "2022-06-18"
|
||||||
symbols:
|
symbols:
|
||||||
- GMTUSDT
|
- ETHUSDT
|
||||||
accounts:
|
accounts:
|
||||||
binance:
|
binance:
|
||||||
balances:
|
balances:
|
||||||
GMT: 3010.0
|
ETH: 10.0
|
||||||
USDT: 1000.0
|
USDT: 5000.0
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# usage:
|
# usage:
|
||||||
#
|
#
|
||||||
# go run ./cmd/bbgo optimize --config config/pivotshort-ETHUSDT.yaml --optimizer-config config/pivotshort_optimizer.yaml --debug
|
# go run ./cmd/bbgo optimize --config config/pivotshort.yaml --optimizer-config config/pivotshort_optimizer.yaml --debug
|
||||||
#
|
#
|
||||||
---
|
---
|
||||||
executor:
|
executor:
|
||||||
|
@ -22,31 +22,44 @@ matrix:
|
||||||
max: 200.0
|
max: 200.0
|
||||||
step: 20.0
|
step: 20.0
|
||||||
|
|
||||||
# - type: range
|
- type: range
|
||||||
# path: '/exchangeStrategies/0/pivotshort/breakLow/stopEMARange'
|
path: '/exchangeStrategies/0/pivotshort/breakLow/stopEMARange'
|
||||||
# label: stopEMARange
|
label: stopEMARange
|
||||||
# min: 0%
|
min: 0%
|
||||||
# max: 10%
|
max: 10%
|
||||||
# step: 1%
|
step: 1%
|
||||||
|
|
||||||
# - type: range
|
- type: range
|
||||||
# path: '/exchangeStrategies/0/pivotshort/exit/roiStopLossPercentage'
|
path: '/exchangeStrategies/0/pivotshort/exits/0/roiStopLoss/percentage'
|
||||||
# label: roiStopLossPercentage
|
label: roiStopLossPercentage
|
||||||
# min: 0.5%
|
min: 0.5%
|
||||||
# max: 2%
|
max: 2%
|
||||||
# step: 0.5%
|
step: 0.1%
|
||||||
#
|
|
||||||
# - type: range
|
- type: range
|
||||||
# path: '/exchangeStrategies/0/pivotshort/exit/roiTakeProfitPercentage'
|
path: '/exchangeStrategies/0/pivotshort/exits/1/roiTakeProfit/percentage'
|
||||||
# label: roiTakeProfitPercentage
|
label: roiTakeProfit
|
||||||
# min: 10%
|
min: 10%
|
||||||
# max: 50%
|
max: 40%
|
||||||
# step: 5%
|
step: 5%
|
||||||
#
|
|
||||||
# - type: range
|
- type: range
|
||||||
# path: '/exchangeStrategies/0/pivotshort/exit/roiMinTakeProfitPercentage'
|
path: '/exchangeStrategies/0/pivotshort/exits/2/protectionStopLoss/activationRatio'
|
||||||
# label: roiMinTakeProfitPercentage
|
label: protectionStopLoss_activationRatio
|
||||||
# min: 3%
|
min: 0.5%
|
||||||
# max: 10%
|
max: 3%
|
||||||
# step: 1%
|
step: 0.1%
|
||||||
#
|
|
||||||
|
- type: range
|
||||||
|
path: '/exchangeStrategies/0/pivotshort/exits/4/lowerShadowTakeProfit/ratio'
|
||||||
|
label: lowerShadowTakeProfit_ratio
|
||||||
|
min: 1%
|
||||||
|
max: 10%
|
||||||
|
step: 1%
|
||||||
|
|
||||||
|
- type: range
|
||||||
|
path: '/exchangeStrategies/0/pivotshort/exits/5/cumulatedVolumeTakeProfit/minQuoteVolume'
|
||||||
|
label: cumulatedVolumeTakeProfit_minQuoteVolume
|
||||||
|
min: 30_000_000
|
||||||
|
max: 200_000_000
|
||||||
|
step: 10_000_000
|
||||||
|
|
Loading…
Reference in New Issue
Block a user