analyue to analyze.sh

This commit is contained in:
olli 2023-11-28 16:57:22 +01:00
parent 22834209c4
commit d502a4e28b
2 changed files with 33 additions and 18 deletions

View File

@ -118,6 +118,21 @@ function analyze {
check_buy_conditions ${g_tmp}/${tmpfile} #| tee -a ${g_tmp}/output-${tmpfile}
fi
fi
if [ -n "${f_SELL}" ]
then
echo "SELL: ${f_date} ${f_SELL}"
g_percentage-diff ${BUY_PRICE} ${f_price}
g_calc "${g_percentage_diff_result}-${FEE}"
result=${g_calc_result}
echo "${result}" >>${g_tmp}/result-${tmpfile}
rm -f "${f_TRADE_HIST_FILE}"
rm -f "${f_TRADE_HIST_FILE_INTERIM}"
unset f_open_trade
echo "RESULT: ${result}% (${BUY_PRICE} -> ${f_price})"
fi
## Chart Part
#local f_intrade=0
#local f_score=${f_buy_score}

View File

@ -99,24 +99,24 @@ function check_sell_conditions {
fi
fi
# ANALYZE
if [ -n "${f_SELL}" ] && [ -z "${BOT}" ]
then
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}"
g_percentage-diff ${BUY_PRICE} ${f_price}
#result=${g_percentage_diff_result}
g_calc "${g_percentage_diff_result}-${FEE}"
result=${g_calc_result}
echo "${result}" >>${g_tmp}/result-${tmpfile}
rm -f "${f_TRADE_HIST_FILE}"
rm -f "${f_TRADE_HIST_FILE_INTERIM}"
unset f_open_trade
#echo "RESULT: ${result}% (${BUY_PRICE} -> ${current})"
echo "RESULT: ${result}% (${BUY_PRICE} -> ${f_price})"
fi
# # ANALYZE
# if [ -n "${f_SELL}" ] && [ -z "${BOT}" ]
# then
# 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}"
# g_percentage-diff ${BUY_PRICE} ${f_price}
# #result=${g_percentage_diff_result}
# g_calc "${g_percentage_diff_result}-${FEE}"
# result=${g_calc_result}
# echo "${result}" >>${g_tmp}/result-${tmpfile}
# rm -f "${f_TRADE_HIST_FILE}"
# rm -f "${f_TRADE_HIST_FILE_INTERIM}"
# unset f_open_trade
# #echo "RESULT: ${result}% (${BUY_PRICE} -> ${current})"
# echo "RESULT: ${result}% (${BUY_PRICE} -> ${f_price})"
# fi
}