update setup grid script

This commit is contained in:
c9s 2021-12-30 13:49:07 +08:00
parent 82fe20fbba
commit 0b5f1a99b3

View File

@ -25,6 +25,14 @@ osf=$(uname | tr '[:upper:]' '[:lower:]')
arch=amd64
version=v1.21.1
dist_file=bbgo-$version-$osf-$arch.tar.gz
exchange=max
if [[ -n $1 ]] ; then
exchange=$1
fi
exchange_upper=$(echo -n $exchange | tr 'a-z' 'A-Z')
info "downloading..."
curl -O -L https://github.com/c9s/bbgo/releases/download/$version/$dist_file
@ -35,12 +43,12 @@ info "downloaded successfully"
function gen_dotenv()
{
read -p "Enter your MAX API key: " api_key
read -p "Enter your MAX API secret: " api_secret
read -p "Enter your $exchange_upper API key: " api_key
read -p "Enter your $exchange_upper API secret: " api_secret
info "generating your .env.local file..."
cat <<END > .env.local
MAX_API_KEY=$api_key
MAX_API_SECRET=$api_secret
${exchange_upper}_API_KEY=$api_key
${exchange_upper}_API_SECRET=$api_secret
END
info "dotenv is configured successfully"
@ -68,7 +76,7 @@ fi
cat <<END > bbgo.yaml
---
exchangeStrategies:
- on: max
- on: ${exchange}
grid:
symbol: BTCUSDT
quantity: 0.001