bbgo_origin/doc/strategy/marketcap.md

29 lines
1.1 KiB
Markdown
Raw Normal View History

2022-09-15 06:17:04 +00:00
### Marketcap Strategy
This strategy will rebalance your portfolio according to the market capitalization from coinmarketcap.
### Prerequisite
Setup your `COINMARKETCAP_API_KEY` in your environment variables.
#### Parameters
- `interval`
- The interval to rebalance your portfolio, e.g., `5m`, `1h`
- `baseCurrency`
- The base currency of your portfolio, e.g., `USDT`, `TWD`.
- `baseWeight`
- The weight of the base currency in your portfolio. The rest of the weight will be distributed to other currencies by market capitalization.
- `targetCurrencies`
- A list of currencies you want to hold in your portfolio.
- `threshold`
- The threshold of the difference between the current weight and the target weight to trigger rebalancing. For example, if the threshold is `1%` and the current weight of `BTC` is `52%` and the target weight is `50%` then the strategy will sell `BTC` until it reaches `50%`.
- `dryRun`
- If `true`, then the strategy will not place orders.
- `maxAmount`
- The maximum amount of each order in base currency.
#### Examples
See [marketcap.yaml](../../config/marketcap.yaml)