From 0b5f1a99b3c823a34cc49c24493d0a419bf1d710 Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 30 Dec 2021 13:49:07 +0800 Subject: [PATCH] update setup grid script --- scripts/setup-grid.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/setup-grid.sh b/scripts/setup-grid.sh index b004798d5..bdb402903 100755 --- a/scripts/setup-grid.sh +++ b/scripts/setup-grid.sh @@ -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 < .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 < bbgo.yaml --- exchangeStrategies: -- on: max +- on: ${exchange} grid: symbol: BTCUSDT quantity: 0.001