diff --git a/.gitignore b/.gitignore index 24401c5..9f4269e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,7 @@ data/index.html data/index.html.tmp dabo/.binance-secrets dabo/.bitpanda-secrets -home/.ssh/ +home/.ssh +home/.viminfo +home/.bash_history +home/.dabo-bot.sh.lock diff --git a/README.md b/README.md index 3d4cab2..143cd02 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ I thought this fits quite well to the cryptotrading world and that's why i chose # Features ## General: -- Compatible with the following crypto exchanges: Binance +- Compatible with the following crypto exchanges: Binance, Bitpanda - Consideration of trading fees - Automatic selection of cryptocurrencies to invest in - Filtering of cryptocurrencies by market capitalization (data via coingecko API) e.g. only trade the 50 largest by market capitalization if available on the exchange @@ -27,6 +27,7 @@ I thought this fits quite well to the cryptotrading world and that's why i chose - Recording of available price values incl. RSI and MACD indicators of available cryptocurrencies - Analysis tool for collected historical values to try out buy or sell conditions based on them - ReadOnly web interface for overview +- Runnable in a non-root docker container ## Buy conditions - definable RSI Indicator signals min/max (RSI5, 14 and 21) @@ -78,4 +79,3 @@ The access rights to this file should be set to the minimum necessary for securi - Overview trades/profits/losses for tax declaration - Support for decentralized exchanges like uniswap to gain more "security" - mutliple trading strategies -- run in a docker container diff --git a/dabo/dabo-bot.conf b/dabo/dabo-bot.conf index 9b4e979..b199915 100755 --- a/dabo/dabo-bot.conf +++ b/dabo/dabo-bot.conf @@ -16,7 +16,7 @@ TRANSFER_CURRENCY="NONE" LARGEST_MARKETCAP="250" # Blacklist Currencies -BLACKLIST="^DAI${CURRENCY}|^BUSD${CURRENCY}|^USDC${CURRENCY}|^USDP${CURRENCY}|^TUSD${CURRENCY}|^USDD${CURRENCY}|^GUSD${CURRENCY}|^FEI${CURRENCY}|^USTC${CURRENCY}|^FRAX${CURRENCY}|^USDJ${CURRENCY}|^LUSD${CURRENCY}|^EURS${CURRENCY}|^TRIBE${CURRENCY}|^BNB${CURRENCY}" +BLACKLIST="^USDT${CURRENCY}|^DAI${CURRENCY}|^BUSD${CURRENCY}|^USDC${CURRENCY}|^USDP${CURRENCY}|^TUSD${CURRENCY}|^USDD${CURRENCY}|^GUSD${CURRENCY}|^FEI${CURRENCY}|^USTC${CURRENCY}|^FRAX${CURRENCY}|^USDJ${CURRENCY}|^LUSD${CURRENCY}|^EURS${CURRENCY}|^TRIBE${CURRENCY}|^BNB${CURRENCY}" ## Signal Group for Notifications SIGNAL_GROUP="Krypto-Bot" @@ -29,7 +29,7 @@ INVEST="5" # The market performance is calculated from the average percentage development of various indicators such as development MSCI World, Bitcoin and Ethereum as well as forecasts. # for details see functions/market_performance.sh # If the market performance is under this value no buying will be done -GOOD_MARKET_PERFORMANCE_INDEX="0.3" +GOOD_MARKET_PERFORMANCE_INDEX="-1" # Stop all trading and sell everything if the complete balance shrinks under this value in ${CURRENCY} EMERGENCY_STOP="190" @@ -66,7 +66,7 @@ BUY_RSI720_SIGNAL_FROM="0" # Here you can specify a percentage range. # If only the buy signal should be considered, simply specify the range 0 and 100. # decimal numbers are not allowed here. -BUY_MACD_RELATION_FROM="60" +BUY_MACD_RELATION_FROM="40" BUY_MACD_RELATION_TO="95" # Don't buy if price change is under this percentage values diff --git a/dabo/functions/bitpanda-api-call.sh b/dabo/functions/bitpanda-api-call.sh index 2ffb0f8..070519c 100644 --- a/dabo/functions/bitpanda-api-call.sh +++ b/dabo/functions/bitpanda-api-call.sh @@ -15,9 +15,10 @@ function bitpanda-api-call { fi echo "${call}" | egrep -q "/account/" && local f_token="-H 'Authorization: Bearer ${API_TOKEN}'" - echo "curl -s -X ${method} --url https://api.exchange.bitpanda.com/${call} $f_token -H 'Accept: application/json'" >${g_tmp}/API_CMD + echo "curl -s -X ${method} --url https://api.exchange.bitpanda.com/${call} $f_token -H 'Accept: application/json' ${params}" >${g_tmp}/API_CMD echo "curl -s -X ${method} --url https://api.exchange.bitpanda.com/${call} -H 'Accept: application/json'" >${g_tmp}/API_CMD_WO_KEY g_runcmd g_retrycmd sh ${g_tmp}/API_CMD >${g_tmp}/API_CMD_OUT 2>&1 + if egrep -q -i '^{"code":|error' ${g_tmp}/API_CMD_OUT then g_echo_error "$(cat ${g_tmp}/API_CMD_WO_KEY): $(cat ${g_tmp}/API_CMD_OUT)" diff --git a/dabo/functions/get_assets.sh b/dabo/functions/get_assets.sh index 18e2f5d..b92ad83 100644 --- a/dabo/functions/get_assets.sh +++ b/dabo/functions/get_assets.sh @@ -14,7 +14,7 @@ function get_assets { elif [ ${STOCK_EXCHANGE} = "BITPANDA" ] then bitpanda-api-call GET "public/v1/market-ticker" || return 1 - cat ${g_tmp}/API_CMD_OUT | jq -r '.[] | .instrument_code + "," + .last_price' | sed 's/_//' | grep "${CURRENCY}," | egrep -v "${TRANSFER_CURRENCY},|,0[\.][0]*$" >${f_filename}_OUT.tmp + cat ${g_tmp}/API_CMD_OUT | jq -r '.[] | select(.state=="ACTIVE") | .instrument_code + "," + .last_price' | sed 's/_//' | grep "${CURRENCY}," | egrep -v "${TRANSFER_CURRENCY},|,0[\.][0]*$" >${f_filename}_OUT.tmp fi # timestamp for data @@ -95,43 +95,7 @@ function get_assets { . /tmp/parallel # cleanup trashlines (possibly generated by kill further of this progress) - sed -i "/[0-9]$(date +%Y)-/d" asset-histories/* - - #cat ASSETS | while read f_ASSET - #do - # # write asset hist file with macd and rsi - # local f_ASSET_HIST_FILE="asset-histories/${f_ASSET}.history.csv" - # [ -f "${f_ASSET_HIST_FILE}" ] || touch "${f_ASSET_HIST_FILE}" - # if ! grep -q "^$(echo "${f_timestamp}" | cut -d: -f1,2)" "${f_ASSET_HIST_FILE}" - # then - # local f_line="${f_timestamp},$(egrep "^${f_ASSET}," EXCHANGE_GET_ASSETS_CMD_OUT | cut -d, -f2)" - # #g_echo_note "Writing new line (${f_line}) to history ${ASSET_HIST_FILE}" - # echo -n "${f_line}" >>${f_ASSET_HIST_FILE} - # get_macd_indicator ${f_ASSET_HIST_FILE} - # get_rsi_indicator ${f_ASSET_HIST_FILE} 30 - # echo ",${f_macd},${f_rsi}" >>${f_ASSET_HIST_FILE} - # fi - - -# cat ASSETS | while read f_ASSET -# do -# # ignore already invested asset -# if echo "$f_ASSET" | egrep -q "$f_investedassets_regex" -# then -# g_echo_note "Already invested in $f_ASSET - ignoring for more diversification" -# continue -# fi -# -# # sort latest assets prices by highest in last timeframe (ignore - or 0) -# get_rate_percentage_min_before_and_now $(echo ${f_ASSET} | sed "s/${CURRENCY}\$//") ${CURRENCY} 1 || continue -# local f_ASSET_PERCENTAGE=${f_exchange_rate_diff_percentage} -# echo "$f_ASSET_PERCENTAGE" | egrep -q '^-|^0.0' && continue -# g_echo "adding ${f_ASSET}({$f_ASSET_PERCENTAGE}) to ASSETS_HIGHEST because marketcap in Top ${LARGEST_MARKETCAP}" -# echo "${f_ASSET_PERCENTAGE},${f_ASSET}" >>ASSETS_HIGHEST.tmp -# done -# cat ASSETS_HIGHEST.tmp | sort -r >ASSETS_HIGHEST.tmp2 -# mv ASSETS_HIGHEST.tmp2 ASSETS_HIGHEST -# rm ASSETS_HIGHEST.tmp + #sed -i "/[0-9]$(date +%Y)-/d" asset-histories/* # get MSCI World Index for analysis echo "wget -q -O - https://www.boerse.de/realtime-kurse/MSCI-World/XC0009692739 | egrep 'itemprop=\"price\" content=\"[0-9]+\.[0-9]+\"' | cut -d\\\" -f6" >MSCI_WORLD_CMD diff --git a/home/.bash_history b/home/.bash_history deleted file mode 100644 index dc69106..0000000 --- a/home/.bash_history +++ /dev/null @@ -1,3 +0,0 @@ -id -ps ax -ps aux diff --git a/home/.dabo-bot.sh.lock b/home/.dabo-bot.sh.lock deleted file mode 100644 index d00491f..0000000 --- a/home/.dabo-bot.sh.lock +++ /dev/null @@ -1 +0,0 @@ -1