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

@ -46,7 +46,7 @@ function analyze {
time=$(echo $line | cut -d, -f1 | cut -d: -f1,2)
f_market_performance=$(grep "^$time" data/botdata/MARKET_PERFORMANCE | tail -n1 | cut -d: -f4 | cut -d"%" -f1 | sed 's/ *//')
echo "$line" >>${g_tmp}/${tmpfile}
echo "${line},${f_market_performance}" | perl -pe 's/([0-9].[0-9][0-9][0-9][0-9][0-9][0-9])[0-9]+/$1/g' | column -t -s, >>${g_tmp}/output-${tmpfile}
echo " ${line},${f_market_performance}" | perl -pe 's/([0-9].[0-9][0-9][0-9][0-9][0-9][0-9])[0-9]+/$1/g' | column -t -s, >>${g_tmp}/output-${tmpfile}
if [ -f "${g_tmp}/open-${tmpfile}" ]
then
if [ "${ANALYZE_VERBOSE}" -eq "0" ]

View File

@ -49,8 +49,6 @@ ${f_last_line},${f_market_performance}"
then
echo "${f_last_line},${f_ASSET}" >>trade.log
f_BUY="${f_echo_prefix}All BUY conditions met!!!
${f_BUY}"
g_echo_note "${f_BUY}"
# calculate quantity from balance for potentially invest
@ -94,10 +92,10 @@ ${f_BUY}"
# ANALYZE
if [ -n "$f_BUY" ] && [ -z "${BOT}" ]
then
echo "BUY: ${f_echo_prefix}${f_BUY}"
echo "BUY: ${f_BUY}"
#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,
echo "$f_BUY" >${g_tmp}/open-${tmpfile}
echo "${f_echo_prefix}${f_BUY}" >${g_tmp}/open-${tmpfile}
BUY_PRICE=$current
f_BUY=""
fi
@ -125,7 +123,7 @@ function check_buy_conditions_strategy {
# Check market-performance
if [ $(echo "${f_market_performance} > ${GOOD_MARKET_PERFORMANCE_INDEX}" | bc -l) -eq 0 ]
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
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=${BUY_PRICE}
result=${f_BUY_PRICE_LAST_RATE_DIFF}
echo "${f_last_line}"
echo "INTERIM RESULT: ${f_BUY_PRICE_LAST_RATE_DIFF}%"
fi
# store new interim result
@ -80,10 +79,10 @@ function check_sell_conditions {
# ANALYZE
if [ -n "${f_SELL}" ] && [ -z "${BOT}" ]
then
echo "SELL: $(tail -n1 ${f_ASSET_HIST_FILE} | cut -d, -f1)"
echo "SELL: $f_date ${f_SELL}"
# 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,
echo "${f_SELL}"
# echo "${f_SELL}"
result=$(g_percentage-diff ${BUY_PRICE} ${current})
result=$(echo "${result}-${FEE}" | bc | sed 's/^\./0./; s/^-\./-0./')
echo "${result}" >>${g_tmp}/result-${tmpfile}