Skip to content

Commit

Permalink
feature: add cmd document
Browse files Browse the repository at this point in the history
add documentation index
  • Loading branch information
zenixls2 committed Feb 22, 2022
1 parent 208a9bc commit 06e9450
Show file tree
Hide file tree
Showing 37 changed files with 1,096 additions and 7 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ A trading bot framework written in Go. The name bbgo comes from the BB8 bot in t
[![Telegram Taiwan](https://img.shields.io/badge/telegram-tw-blue.svg)](https://t.me/bbgocrypto)
[![Twitter](https://img.shields.io/twitter/follow/bbgotrading?label=Follow&style=social)](https://twitter.com/bbgotrading)

## Documentation and General Topics
- Check the [documentation index](doc/README.md)

## Features

- Exchange abstraction interface.
Expand Down Expand Up @@ -45,6 +48,10 @@ A trading bot framework written in Go. The name bbgo comes from the BB8 bot in t
- Kucoin Spot Exchange
- MAX Spot Exchange (located in Taiwan)

## BBGO Tokenomics
To support the development of BBGO, we have created a bounty pool to support contributors by giving away $BBG tokens.
Check the details in [$BBG Contract Page](contracts/README.md) and our [official website](https://bbgo.finance)

## Requirements

Get your exchange API key and secret after you register the accounts (you can choose one or more exchanges):
Expand Down
19 changes: 19 additions & 0 deletions cmd/update-doc/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package main

import (
"github.com/c9s/bbgo/pkg/cmd"
"github.com/spf13/cobra/doc"
"path"
"runtime"
"fmt"
"log"
)

func main() {
_, b, _, _ := runtime.Caller(0)
root := path.Join(path.Dir(path.Dir(path.Dir(b))), "doc", "commands")
fmt.Println(root)
if err := doc.GenMarkdownTree(cmd.RootCmd, root); err != nil {
log.Fatal(err)
}
}
31 changes: 31 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# BBGO Documentation Index
--------------------------

### General Topics
* [bbgo command index](commands/bbgo.md) - BBGO prompt user interface
* [bbgo build](build-from-source.md) - How to build bbgo
* [bbgo backtest](topics/back-testing.md) - How to backtesting strategies
* [bbgo TWAP](topics/twap.md) - TWAP order execution to buy/sell large quantity of order

### Configuration
* [bbgo slack](configuration/slack.md) - Setting up Slack Notification
* [bbgo telegram](configuration/telegram.md) - Setting up Telegram Bot Notification
* [bbgo env](configuration/envvars.md) - Environment variables
* [bbgo sync](configuration/sync.md) - Synchronize private trading data

### Deployment
* [bbgo chart](deployment/helm-chart.md) - Helm Chart setup

### Development
* [bbgo new exchange](development/adding-new-exchange.md) - Check lists for adding new exchanges
* [bbgo kucoin cli](development/kucoin-cli.md) - Kucoin command-line tools
* [bbgo sql migration](development/migration.md) - Adding new SQL migration scripts
* [bbgo release process](development/release-process.md) - How to make a new release

### Strategies
* [bbgo grid](strategy/grid.md) - Grid Strategy Explanation
* [bbgo interaction](strategy/interaction.md) - Interaction registration for strategies
* [bbgo price alert](strategy/pricealert.md) - Send price alert notification on price changes
* [bbgo support](strategy/support.md) - Support strategy that buys on high volume support


57 changes: 57 additions & 0 deletions doc/commands/bbgo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## bbgo

bbgo is a crypto trading bot

```
bbgo [flags]
```

### Options

```
--binance-api-key string binance api key
--binance-api-secret string binance api secret
--config string config file (default "bbgo.yaml")
--debug debug mode
--dotenv string the dotenv file you want to load (default ".env.local")
--ftx-api-key string ftx api key
--ftx-api-secret string ftx api secret
--ftx-subaccount string subaccount name. Specify it if the credential is for subaccount.
-h, --help help for bbgo
--max-api-key string max api key
--max-api-secret string max api secret
--metrics enable prometheus metrics
--metrics-port string prometheus http server port (default "9090")
--no-dotenv disable built-in dotenv
--slack-channel string slack trading channel (default "dev-bbgo")
--slack-error-channel string slack error channel (default "bbgo-error")
--slack-token string slack token
--telegram-bot-auth-token string telegram auth token
--telegram-bot-token string telegram bot token from bot father
```

### SEE ALSO

* [bbgo account](bbgo_account.md) - show user account details (ex: balance)
* [bbgo backtest](bbgo_backtest.md) - backtest your strategies
* [bbgo balances](bbgo_balances.md) - Show user account balances
* [bbgo build](bbgo_build.md) - build cross-platform binary
* [bbgo cancel-order](bbgo_cancel-order.md) - cancel orders
* [bbgo deposits](bbgo_deposits.md) - A testing utility that will query deposition history in last 7 days
* [bbgo execute-order](bbgo_execute-order.md) - execute buy/sell on the balance/position you have on specific symbol
* [bbgo kline](bbgo_kline.md) - connect to the kline market data streaming service of an exchange
* [bbgo list-orders](bbgo_list-orders.md) - list user's open orders in exchange of a specific trading pair
* [bbgo market](bbgo_market.md) - List the symbols that the are available to be traded in the exchange
* [bbgo orderbook](bbgo_orderbook.md) - connect to the order book market data streaming service of an exchange
* [bbgo orderupdate](bbgo_orderupdate.md) - Listen to order update events
* [bbgo pnl](bbgo_pnl.md) - pnl calculator
* [bbgo run](bbgo_run.md) - run strategies from config file
* [bbgo submit-order](bbgo_submit-order.md) - submit limit order to the exchange
* [bbgo sync](bbgo_sync.md) - sync trades and orders history
* [bbgo trades](bbgo_trades.md) - Query trading history
* [bbgo tradeupdate](bbgo_tradeupdate.md) - Listen to trade update events
* [bbgo transfer-history](bbgo_transfer-history.md) - show transfer history
* [bbgo userdatastream](bbgo_userdatastream.md) - Listen to session events (orderUpdate, tradeUpdate, balanceUpdate, balanceSnapshot)
* [bbgo version](bbgo_version.md) - show version name

###### Auto generated by spf13/cobra on 22-Feb-2022
44 changes: 44 additions & 0 deletions doc/commands/bbgo_account.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## bbgo account

show user account details (ex: balance)

```
bbgo account [--session=[exchange_name]] [flags]
```

### Options

```
-h, --help help for account
--session string the exchange session name for querying information
--total report total asset
```

### Options inherited from parent commands

```
--binance-api-key string binance api key
--binance-api-secret string binance api secret
--config string config file (default "bbgo.yaml")
--debug debug mode
--dotenv string the dotenv file you want to load (default ".env.local")
--ftx-api-key string ftx api key
--ftx-api-secret string ftx api secret
--ftx-subaccount string subaccount name. Specify it if the credential is for subaccount.
--max-api-key string max api key
--max-api-secret string max api secret
--metrics enable prometheus metrics
--metrics-port string prometheus http server port (default "9090")
--no-dotenv disable built-in dotenv
--slack-channel string slack trading channel (default "dev-bbgo")
--slack-error-channel string slack error channel (default "bbgo-error")
--slack-token string slack token
--telegram-bot-auth-token string telegram auth token
--telegram-bot-token string telegram bot token from bot father
```

### SEE ALSO

* [bbgo](bbgo.md) - bbgo is a crypto trading bot

###### Auto generated by spf13/cobra on 22-Feb-2022
51 changes: 51 additions & 0 deletions doc/commands/bbgo_backtest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## bbgo backtest

backtest your strategies

```
bbgo backtest [flags]
```

### Options

```
--base-asset-baseline use base asset performance as the competitive baseline performance
--exchange string target exchange
--force force execution without confirm
-h, --help help for backtest
--output string the report output directory
--sync sync backtest data
--sync-from string sync backtest data from the given time, which will override the time range in the backtest config
--sync-only sync backtest data only, do not run backtest
-v, --verbose count verbose level
--verify verify the kline back-test data
```

### Options inherited from parent commands

```
--binance-api-key string binance api key
--binance-api-secret string binance api secret
--config string config file (default "bbgo.yaml")
--debug debug mode
--dotenv string the dotenv file you want to load (default ".env.local")
--ftx-api-key string ftx api key
--ftx-api-secret string ftx api secret
--ftx-subaccount string subaccount name. Specify it if the credential is for subaccount.
--max-api-key string max api key
--max-api-secret string max api secret
--metrics enable prometheus metrics
--metrics-port string prometheus http server port (default "9090")
--no-dotenv disable built-in dotenv
--slack-channel string slack trading channel (default "dev-bbgo")
--slack-error-channel string slack error channel (default "bbgo-error")
--slack-token string slack token
--telegram-bot-auth-token string telegram auth token
--telegram-bot-token string telegram bot token from bot father
```

### SEE ALSO

* [bbgo](bbgo.md) - bbgo is a crypto trading bot

###### Auto generated by spf13/cobra on 22-Feb-2022
43 changes: 43 additions & 0 deletions doc/commands/bbgo_balances.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## bbgo balances

Show user account balances

```
bbgo balances [flags]
```

### Options

```
-h, --help help for balances
--session string the exchange session name for querying balances
```

### Options inherited from parent commands

```
--binance-api-key string binance api key
--binance-api-secret string binance api secret
--config string config file (default "bbgo.yaml")
--debug debug mode
--dotenv string the dotenv file you want to load (default ".env.local")
--ftx-api-key string ftx api key
--ftx-api-secret string ftx api secret
--ftx-subaccount string subaccount name. Specify it if the credential is for subaccount.
--max-api-key string max api key
--max-api-secret string max api secret
--metrics enable prometheus metrics
--metrics-port string prometheus http server port (default "9090")
--no-dotenv disable built-in dotenv
--slack-channel string slack trading channel (default "dev-bbgo")
--slack-error-channel string slack error channel (default "bbgo-error")
--slack-token string slack token
--telegram-bot-auth-token string telegram auth token
--telegram-bot-token string telegram bot token from bot father
```

### SEE ALSO

* [bbgo](bbgo.md) - bbgo is a crypto trading bot

###### Auto generated by spf13/cobra on 22-Feb-2022
42 changes: 42 additions & 0 deletions doc/commands/bbgo_build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
## bbgo build

build cross-platform binary

```
bbgo build [flags]
```

### Options

```
-h, --help help for build
```

### Options inherited from parent commands

```
--binance-api-key string binance api key
--binance-api-secret string binance api secret
--config string config file (default "bbgo.yaml")
--debug debug mode
--dotenv string the dotenv file you want to load (default ".env.local")
--ftx-api-key string ftx api key
--ftx-api-secret string ftx api secret
--ftx-subaccount string subaccount name. Specify it if the credential is for subaccount.
--max-api-key string max api key
--max-api-secret string max api secret
--metrics enable prometheus metrics
--metrics-port string prometheus http server port (default "9090")
--no-dotenv disable built-in dotenv
--slack-channel string slack trading channel (default "dev-bbgo")
--slack-error-channel string slack error channel (default "bbgo-error")
--slack-token string slack token
--telegram-bot-auth-token string telegram auth token
--telegram-bot-token string telegram bot token from bot father
```

### SEE ALSO

* [bbgo](bbgo.md) - bbgo is a crypto trading bot

###### Auto generated by spf13/cobra on 22-Feb-2022
52 changes: 52 additions & 0 deletions doc/commands/bbgo_cancel-order.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## bbgo cancel-order

cancel orders

### Synopsis

this command can cancel orders from exchange

```
bbgo cancel-order [flags]
```

### Options

```
--all cancel all orders
--group-id int group ID to cancel orders
-h, --help help for cancel-order
--order-id uint order ID to cancel orders
--order-uuid string order UUID to cancel orders
--session string session to execute cancel orders
--symbol string symbol to cancel orders
```

### Options inherited from parent commands

```
--binance-api-key string binance api key
--binance-api-secret string binance api secret
--config string config file (default "bbgo.yaml")
--debug debug mode
--dotenv string the dotenv file you want to load (default ".env.local")
--ftx-api-key string ftx api key
--ftx-api-secret string ftx api secret
--ftx-subaccount string subaccount name. Specify it if the credential is for subaccount.
--max-api-key string max api key
--max-api-secret string max api secret
--metrics enable prometheus metrics
--metrics-port string prometheus http server port (default "9090")
--no-dotenv disable built-in dotenv
--slack-channel string slack trading channel (default "dev-bbgo")
--slack-error-channel string slack error channel (default "bbgo-error")
--slack-token string slack token
--telegram-bot-auth-token string telegram auth token
--telegram-bot-token string telegram bot token from bot father
```

### SEE ALSO

* [bbgo](bbgo.md) - bbgo is a crypto trading bot

###### Auto generated by spf13/cobra on 22-Feb-2022
Loading

0 comments on commit 06e9450

Please sign in to comment.