Indent functions code
This commit is contained in:
parent
96c54716d7
commit
7321836bfb
84
setup.sh
84
setup.sh
@ -1,10 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#encoding=utf8
|
#encoding=utf8
|
||||||
freqtradepath=$(pwd)
|
|
||||||
|
|
||||||
function go_to_folder () {
|
|
||||||
cd $freqtradepath
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateenv () {
|
function updateenv () {
|
||||||
echo "
|
echo "
|
||||||
@ -50,23 +45,18 @@ install_talib
|
|||||||
|
|
||||||
# Upgrade the bot
|
# Upgrade the bot
|
||||||
function update () {
|
function update () {
|
||||||
go_to_folder
|
|
||||||
git pull
|
git pull
|
||||||
updateenv
|
updateenv
|
||||||
}
|
}
|
||||||
|
|
||||||
# Reset Develop or Master branch
|
# Reset Develop or Master branch
|
||||||
function reset () {
|
function reset () {
|
||||||
|
echo "----------------------------"
|
||||||
echo "
|
echo "Reset branch and virtual env"
|
||||||
----------------------------
|
echo "----------------------------"
|
||||||
Reset branch and virtual env
|
echo
|
||||||
----------------------------
|
|
||||||
"
|
|
||||||
if [ "1" == $(git branch -vv |grep -cE "\* develop|\* master") ]
|
if [ "1" == $(git branch -vv |grep -cE "\* develop|\* master") ]
|
||||||
then
|
then
|
||||||
go_to_folder
|
|
||||||
|
|
||||||
if [ -d ".env" ]; then
|
if [ -d ".env" ]; then
|
||||||
echo "- Delete your previous virtual env"
|
echo "- Delete your previous virtual env"
|
||||||
rm -rf .env
|
rm -rf .env
|
||||||
@ -95,42 +85,30 @@ function config_generator () {
|
|||||||
|
|
||||||
echo "Starting to generate config.json"
|
echo "Starting to generate config.json"
|
||||||
|
|
||||||
echo "
|
echo "-------------------------"
|
||||||
-------------------------
|
echo "General configuration"
|
||||||
General configuration
|
echo "-------------------------"
|
||||||
-------------------------
|
echo
|
||||||
"
|
read -p "Max open trades: (Default: 3) " max_trades
|
||||||
read -p "Max open trades: (Default: 3)
|
|
||||||
" max_trades
|
|
||||||
|
|
||||||
read -p "Stake amount: (Default: 0.05)
|
read -p "Stake amount: (Default: 0.05) " stake_amount
|
||||||
" stake_amount
|
|
||||||
|
|
||||||
read -p "Stake currency: (Default: BTC)
|
read -p "Stake currency: (Default: BTC) " stake_currency
|
||||||
" stake_currency
|
|
||||||
|
|
||||||
read -p "Fiat currency: (Default: USD)
|
read -p "Fiat currency: (Default: USD) " fiat_currency
|
||||||
" fiat_currency
|
|
||||||
|
|
||||||
echo "
|
echo "------------------------"
|
||||||
------------------------
|
echo "Bittrex config generator"
|
||||||
Bittrex config generator
|
echo "------------------------"
|
||||||
------------------------
|
echo
|
||||||
"
|
read -p "Exchange API key: " api_key
|
||||||
read -p "Exchange API key
|
read -p "Exchange API Secret: " api_secret
|
||||||
" api_key
|
|
||||||
read -p "Exchange API Secret
|
|
||||||
" -s api_secret
|
|
||||||
|
|
||||||
echo "
|
echo "-------------------------"
|
||||||
-------------------------
|
echo "Telegram config generator"
|
||||||
Telegram config generator
|
echo "-------------------------"
|
||||||
-------------------------
|
read -p "Telegram Token: " token
|
||||||
"
|
read -p "Telegram Chat_id: " chat_id
|
||||||
read -p "Telegram Token
|
|
||||||
" -s token
|
|
||||||
read -p "Telegram Chat_id
|
|
||||||
" chat_id
|
|
||||||
|
|
||||||
sed -e "s/\"max_open_trades\": 3,/\"max_open_trades\": $max_trades,/g" \
|
sed -e "s/\"max_open_trades\": 3,/\"max_open_trades\": $max_trades,/g" \
|
||||||
-e "s/\"stake_amount\": 0.05,/\"stake_amount\": $stake_amount,/g" \
|
-e "s/\"stake_amount\": 0.05,/\"stake_amount\": $stake_amount,/g" \
|
||||||
@ -145,11 +123,9 @@ sed -e "s/\"max_open_trades\": 3,/\"max_open_trades\": $max_trades,/g" \
|
|||||||
}
|
}
|
||||||
|
|
||||||
function config () {
|
function config () {
|
||||||
go_to_folder
|
|
||||||
if [ -f config.json ]
|
if [ -f config.json ]
|
||||||
then
|
then
|
||||||
read -p "A config file already exist, do you want to override it [Y/N]?
|
read -p "A config file already exist, do you want to override it [Y/N]? "
|
||||||
"
|
|
||||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||||
then
|
then
|
||||||
config_generator
|
config_generator
|
||||||
@ -164,13 +140,11 @@ echo "Edit ./config.json to modify Pair and other configurations."
|
|||||||
}
|
}
|
||||||
|
|
||||||
function install () {
|
function install () {
|
||||||
echo "
|
echo "-------------------------"
|
||||||
-------------------------
|
echo "Install mandatory dependencies"
|
||||||
Install mandatory dependencies
|
echo "-------------------------"
|
||||||
-------------------------
|
echo
|
||||||
"
|
|
||||||
|
|
||||||
go_to_folder
|
|
||||||
if [ "$(uname -s)" == "Darwin" ]
|
if [ "$(uname -s)" == "Darwin" ]
|
||||||
then
|
then
|
||||||
echo "- You are on macOS"
|
echo "- You are on macOS"
|
||||||
@ -199,7 +173,7 @@ echo "
|
|||||||
Install dependencies for Plotting scripts
|
Install dependencies for Plotting scripts
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
"
|
"
|
||||||
pip install plotly
|
pip install plotly --upgrade
|
||||||
}
|
}
|
||||||
|
|
||||||
function help () {
|
function help () {
|
||||||
|
Loading…
Reference in New Issue
Block a user