analyze 2 analyze

This commit is contained in:
olli 2023-11-28 17:13:13 +01:00
parent 1423fdbe71
commit 3b1873616c
2 changed files with 22 additions and 25 deletions

View File

@ -118,31 +118,28 @@ function analyze {
check_buy_conditions ${g_tmp}/${tmpfile} #| tee -a ${g_tmp}/output-${tmpfile}
fi
fi
if [ -n "$f_BUY" ]
set -x
if [ -n "${f_BUY}" ]
then
set -x
echo "BUY: ${f_BUY}"
f_open_trade=1
BUY_PRICE=$f_price
f_BUY=""
set +x
fi
if [ -n "${f_SELL}" ]
then
set -x
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})"
set +x
fi
set +x
# 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

View File

@ -44,11 +44,11 @@ function check_buy_conditions {
done
# if this checks came from sell function
if [ "$2" == "SELL" ]
then
[ -n "$f_BUY" ] && return 1
return 0
fi
#if [ "$2" == "SELL" ]
#then
# [ -n "$f_BUY" ] && return 1
# return 0
#fi
### Buy or not buy?
# BOT