mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
commit
8bb106551f
22
README.md
22
README.md
|
@ -202,6 +202,25 @@ bbgo sync --session max
|
||||||
bbgo sync --session binance
|
bbgo sync --session binance
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Using Redis to keep persistence between BBGO sessions
|
||||||
|
|
||||||
|
To use Redis, first you need to install your Redis server:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# For Ubuntu/Debian Linux
|
||||||
|
sudo apt-get install -y redis
|
||||||
|
```
|
||||||
|
|
||||||
|
Set the following environment variables in your `bbgo.yaml`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
persistence:
|
||||||
|
redis:
|
||||||
|
host: 127.0.0.1 # The IP address or the hostname to your Redis server, 127.0.0.1 if same as BBGO
|
||||||
|
port: 6379 # Port to Redis server, default 6379
|
||||||
|
db: 0 # DB number to use. You can set to another DB to avoid conflict if other applications are using Redis too.
|
||||||
|
```
|
||||||
|
|
||||||
## Built-in Strategies
|
## Built-in Strategies
|
||||||
|
|
||||||
Check out the strategy directory [strategy](pkg/strategy) for all built-in strategies:
|
Check out the strategy directory [strategy](pkg/strategy) for all built-in strategies:
|
||||||
|
@ -214,7 +233,8 @@ Check out the strategy directory [strategy](pkg/strategy) for all built-in strat
|
||||||
order [buyandhold](pkg/strategy/pricedrop)
|
order [buyandhold](pkg/strategy/pricedrop)
|
||||||
- `bollgrid` strategy implements a basic grid strategy with the built-in bollinger
|
- `bollgrid` strategy implements a basic grid strategy with the built-in bollinger
|
||||||
indicator [bollgrid](pkg/strategy/bollgrid)
|
indicator [bollgrid](pkg/strategy/bollgrid)
|
||||||
- `grid` strategy implements the fixed price band grid strategy [grid](pkg/strategy/grid)
|
- `grid` strategy implements the fixed price band grid strategy [grid](pkg/strategy/grid). See
|
||||||
|
[document](./doc/strategy/grid.md).
|
||||||
- `support` strategy implements the fixed price band grid strategy [support](pkg/strategy/support). See
|
- `support` strategy implements the fixed price band grid strategy [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)
|
||||||
|
|
31
doc/strategy/grid.md
Normal file
31
doc/strategy/grid.md
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
### Grid Strategy
|
||||||
|
|
||||||
|
This strategy places buy and sell orders within the specified price range. The gap between orders are equal, thus they
|
||||||
|
form `grids`. The price gap is calculated from price range and the number of grids.
|
||||||
|
|
||||||
|
|
||||||
|
#### Parameters
|
||||||
|
|
||||||
|
- `symbol`
|
||||||
|
- The trading pair symbol, e.g., `BTCUSDT`, `ETHUSDT`
|
||||||
|
- `quantity`
|
||||||
|
- Quantity per order
|
||||||
|
- `gridNumber`
|
||||||
|
- Number of grids, which is the maximum numbers of orders minus one.
|
||||||
|
- `profitSpread`
|
||||||
|
- The arbitrage profit amount of a set of buy and sell orders. In other words, the profit you want to add to your
|
||||||
|
sell order when your buy order is executed.
|
||||||
|
- `upperPrice`
|
||||||
|
- The upper bond price
|
||||||
|
- `lowerPrice`
|
||||||
|
- The lower bond price
|
||||||
|
- `long`
|
||||||
|
- If true, the sell order is submitted in the same order amount as the filled corresponding buy order, rather than
|
||||||
|
the same quantity, which means the arbitrage profit is accumulated in the base asset rather than the quote asset.
|
||||||
|
- `catchUp`
|
||||||
|
- If true, BBGO will try to submit orders for missing grids.
|
||||||
|
|
||||||
|
|
||||||
|
#### Examples
|
||||||
|
|
||||||
|
See [grid.yaml](../../config/grid.yaml)
|
Loading…
Reference in New Issue
Block a user