optical fixes

This commit is contained in:
olli 2023-06-01 14:07:57 +02:00
parent 542653b171
commit 0829f533aa
3 changed files with 6 additions and 9 deletions

View File

@ -49,8 +49,6 @@ ${f_last_line},${f_market_performance}"
then then
echo "${f_last_line},${f_ASSET}" >>trade.log echo "${f_last_line},${f_ASSET}" >>trade.log
f_BUY="${f_echo_prefix}All BUY conditions met!!!
${f_BUY}"
g_echo_note "${f_BUY}" g_echo_note "${f_BUY}"
# calculate quantity from balance for potentially invest # calculate quantity from balance for potentially invest
@ -94,10 +92,10 @@ ${f_BUY}"
# ANALYZE # ANALYZE
if [ -n "$f_BUY" ] && [ -z "${BOT}" ] if [ -n "$f_BUY" ] && [ -z "${BOT}" ]
then then
echo "BUY: ${f_echo_prefix}${f_BUY}" echo "BUY: ${f_BUY}"
#echo "${csv_headline},Marketperformance #echo "${csv_headline},Marketperformance
#${f_last_line}" | cut -d, -f 2-22 | perl -pe 's/([0-9].[0-9][0-9][0-9][0-9][0-9][0-9])[0-9]+/$1/g' | perl -pe 's/((?<=,)|(?<=^)),/ ,/g;' | column -t -s, #${f_last_line}" | cut -d, -f 2-22 | perl -pe 's/([0-9].[0-9][0-9][0-9][0-9][0-9][0-9])[0-9]+/$1/g' | perl -pe 's/((?<=,)|(?<=^)),/ ,/g;' | column -t -s,
echo "$f_BUY" >${g_tmp}/open-${tmpfile} echo "${f_echo_prefix}${f_BUY}" >${g_tmp}/open-${tmpfile}
BUY_PRICE=$current BUY_PRICE=$current
f_BUY="" f_BUY=""
fi fi
@ -125,7 +123,7 @@ function check_buy_conditions_strategy {
# Check market-performance # Check market-performance
if [ $(echo "${f_market_performance} > ${GOOD_MARKET_PERFORMANCE_INDEX}" | bc -l) -eq 0 ] if [ $(echo "${f_market_performance} > ${GOOD_MARKET_PERFORMANCE_INDEX}" | bc -l) -eq 0 ]
then then
g_echo_note "${f_echo_prefix}BUY market performance ${f_market_performance}% looks bad - Dont buy anything" #g_echo_note "${f_echo_prefix}BUY market performance ${f_market_performance}% looks bad - Dont buy anything"
return 1 return 1
fi fi

View File

@ -31,7 +31,6 @@ function check_sell_conditions {
f_BUY_PRICE_LAST_RATE_DIFF=$(g_percentage-diff ${BUY_PRICE} ${f_price}) f_BUY_PRICE_LAST_RATE_DIFF=$(g_percentage-diff ${BUY_PRICE} ${f_price})
f_BUY_PRICE=${BUY_PRICE} f_BUY_PRICE=${BUY_PRICE}
result=${f_BUY_PRICE_LAST_RATE_DIFF} result=${f_BUY_PRICE_LAST_RATE_DIFF}
echo "${f_last_line}"
echo "INTERIM RESULT: ${f_BUY_PRICE_LAST_RATE_DIFF}%" echo "INTERIM RESULT: ${f_BUY_PRICE_LAST_RATE_DIFF}%"
fi fi
# store new interim result # store new interim result
@ -80,10 +79,10 @@ function check_sell_conditions {
# ANALYZE # ANALYZE
if [ -n "${f_SELL}" ] && [ -z "${BOT}" ] if [ -n "${f_SELL}" ] && [ -z "${BOT}" ]
then then
echo "SELL: $(tail -n1 ${f_ASSET_HIST_FILE} | cut -d, -f1)" echo "SELL: $f_date ${f_SELL}"
# echo "${csv_headline},Marketperformace # echo "${csv_headline},Marketperformace
#${f_last_line}" | cut -d, -f 2-22 | perl -pe 's/([0-9].[0-9][0-9][0-9][0-9][0-9][0-9])[0-9]+/$1/g' | perl -pe 's/((?<=,)|(?<=^)),/ ,/g;' | column -t -s, #${f_last_line}" | cut -d, -f 2-22 | perl -pe 's/([0-9].[0-9][0-9][0-9][0-9][0-9][0-9])[0-9]+/$1/g' | perl -pe 's/((?<=,)|(?<=^)),/ ,/g;' | column -t -s,
echo "${f_SELL}" # echo "${f_SELL}"
result=$(g_percentage-diff ${BUY_PRICE} ${current}) result=$(g_percentage-diff ${BUY_PRICE} ${current})
result=$(echo "${result}-${FEE}" | bc | sed 's/^\./0./; s/^-\./-0./') result=$(echo "${result}-${FEE}" | bc | sed 's/^\./0./; s/^-\./-0./')
echo "${result}" >>${g_tmp}/result-${tmpfile} echo "${result}" >>${g_tmp}/result-${tmpfile}