mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-24 07:45:15 +00:00
1.6 KiB
1.6 KiB
Rebalance Strategy
This strategy automatically rebalances your portfolio based on target weights.
Parameters
schedule
- The CRON expression used to schedule rebalance executions, for example:
@every 5m
,@every 1h
,0 0 * * * *
. - CRON Expression Format
- The CRON expression used to schedule rebalance executions, for example:
quoteCurrency
- The quote currency in trading markets, e.g.,
USDT
,TWD
.
- The quote currency in trading markets, e.g.,
targetWeights
- A map defining the desired target weights for each base currency in the portfolio.
threshold
- The threshold represents the maximum allowable difference between the current weight and the target weight that will initiate rebalancing. For instance, with a threshold set at
1%
, if the current weight ofBTC
is52%
and the target weight is50%
, the strategy will sellBTC
until it reaches50%
.
- The threshold represents the maximum allowable difference between the current weight and the target weight that will initiate rebalancing. For instance, with a threshold set at
maxAmount
- The highest allowable value for each order in the quote currency.
orderType
- The type of order to be placed, e.g.,
LIMIT
,LIMIT_MAKER
,MARKET
- The type of order to be placed, e.g.,
priceType
- The method used to determine the price for buying or selling the currency, for example,
MAKER
,TAKER
,MID
,LAST
- The method used to determine the price for buying or selling the currency, for example,
balanceType
- Determines how the current weights are calculated. If set to
TOTAL
, the weights will include locked funds. e.g.TOTAL
,AVAILABLE
.
- Determines how the current weights are calculated. If set to
dryRun
- If set to
true
, the strategy will simulate rebalancing without actually placing orders.
- If set to
onStart
- Indicates whether to rebalance the portfolio when the strategy starts.
Examples
See rebalance.yaml