This commit is contained in:
olli 2023-05-19 08:59:09 +02:00
parent 95d9ce2a6c
commit 4510794f32
2 changed files with 6 additions and 5 deletions

View File

@ -59,7 +59,7 @@ function analyze {
do
if [ "${ANALYZE_VERBOSE}" -eq "0" ]
then
check_sell_conditions ${g_tmp}/${tmpfile} "${f_strategy}" >>${g_tmp}/output-${tmpfile} #2>&1
check_sell_conditions ${g_tmp}/${tmpfile} "${f_strategy}" >>${g_tmp}/output-${tmpfile} 2>&1
else
check_sell_conditions ${g_tmp}/${tmpfile} "${f_strategy}" 2>&1 | tee -a ${g_tmp}/output-${tmpfile}
fi
@ -72,7 +72,7 @@ function analyze {
do
if [ "${ANALYZE_VERBOSE}" -eq "0" ]
then
check_buy_conditions ${g_tmp}/${tmpfile} "${f_strategy}" >>${g_tmp}/output-${tmpfile} #2>&1 || break
check_buy_conditions ${g_tmp}/${tmpfile} "${f_strategy}" >>${g_tmp}/output-${tmpfile} 2>&1 || break
else
check_buy_conditions ${g_tmp}/${tmpfile} "${f_strategy}" 2>&1 | tee -a ${g_tmp}/output-${tmpfile}
fi

View File

@ -35,6 +35,9 @@ function check_sell_conditions {
echo "${f_last_line}"
echo "INTERIM RESULT: ${f_BUY_PRICE_LAST_RATE_DIFF}%"
fi
# store new interim result
echo ${f_BUY_PRICE_LAST_RATE_DIFF} >>${f_TRADE_HIST_FILE_INTERIM}
# run strategy
if [ -s "${f_strategy}" ]
@ -46,6 +49,7 @@ function check_sell_conditions {
fi
g_echo_note "${f_echo_prefix}Running SELL checks"
# check if the result (profit/loss until now) is lowering and sell if too low ()
if [ -f ${f_TRADE_HIST_FILE_INTERIM} ]
then
@ -68,9 +72,6 @@ function check_sell_conditions {
fi
fi
# store new interim result
echo ${f_BUY_PRICE_LAST_RATE_DIFF} >>${f_TRADE_HIST_FILE_INTERIM}
# Sell on MACD Condition
if [ $(echo "${f_macd_histogram_relation} < ${SELL_MACD_RELATION_FROM}" | bc -l) -ne 0 ]