From 0466f0d237a61384dccbe82a026de0b629664c39 Mon Sep 17 00:00:00 2001 From: narumi Date: Fri, 22 Mar 2024 14:48:02 +0800 Subject: [PATCH] add rebalance doc --- README.md | 1 + doc/strategy/rebalance.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 doc/strategy/rebalance.md diff --git a/README.md b/README.md index 458c1ea1d2..bc2bfd80da 100644 --- a/README.md +++ b/README.md @@ -412,6 +412,7 @@ Check out the strategy directory [strategy](pkg/strategy) for all built-in strat - `irr` - return rate strategy. - `drift` - drift strategy. - `grid2` - the second-generation grid strategy. +- `rebalance` - rebalances your portfolio based on target weights. [rebalance](pkg/strategy/rebalance). See [document](./doc/strategy/rebalance.md). To run these built-in strategies, just modify the config file to make the configuration suitable for you, for example, if you want to run diff --git a/doc/strategy/rebalance.md b/doc/strategy/rebalance.md new file mode 100644 index 0000000000..9508c4bea4 --- /dev/null +++ b/doc/strategy/rebalance.md @@ -0,0 +1,31 @@ +### 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](https://pkg.go.dev/github.com/robfig/cron#hdr-CRON_Expression_Format) +- `quoteCurrency` + - The quote currency in trading markets, e.g., `USDT`, `TWD`. +- `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 of `BTC` is `52%` and the target weight is `50%`, the strategy will sell `BTC` until it reaches `50%`. +- `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` +- `priceType` + - The method used to determine the price for buying or selling the currency, for example, `MAKER`, `TAKER`, `MID`, `LAST` +- `balanceType` + - Determines how the current weights are calculated. If set to `TOTAL`, the weights will include locked funds. e.g. `TOTAL`, `AVAILABLE`. +- `dryRun` + - If set to `true`, the strategy will simulate rebalancing without actually placing orders. +- `onStart` + - Indicates whether to rebalance the portfolio when the strategy starts. + +#### Examples + +See [rebalance.yaml](../../config/rebalance.yaml)