mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
add marketcap doc
This commit is contained in:
parent
72f18c1057
commit
d236cde529
|
@ -353,6 +353,8 @@ Check out the strategy directory [strategy](pkg/strategy) for all built-in strat
|
||||||
- `support` strategy uses K-lines with high volume as support [support](pkg/strategy/support). See
|
- `support` strategy uses K-lines with high volume as support [support](pkg/strategy/support). See
|
||||||
[document](./doc/strategy/support.md).
|
[document](./doc/strategy/support.md).
|
||||||
- `flashcrash` strategy implements a strategy that catches the flashcrash [flashcrash](pkg/strategy/flashcrash)
|
- `flashcrash` strategy implements a strategy that catches the flashcrash [flashcrash](pkg/strategy/flashcrash)
|
||||||
|
- `marketcap` strategy implements a strategy that rebalances the portfolio based on the
|
||||||
|
market capitalization [marketcap](pkg/strategy/marketcap). See [document](./doc/strategy/marketcap.md).
|
||||||
|
|
||||||
To run these built-in strategies, just modify the config file to make the configuration suitable for you, for example if
|
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
|
you want to run
|
||||||
|
|
28
doc/strategy/marketcap.md
Normal file
28
doc/strategy/marketcap.md
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
### 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)
|
Loading…
Reference in New Issue
Block a user