diff --git a/dabo/analyze.sh b/dabo/analyze.sh index 6256fec..3d4d04d 100755 --- a/dabo/analyze.sh +++ b/dabo/analyze.sh @@ -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 diff --git a/dabo/functions/check_sell_conditions.sh b/dabo/functions/check_sell_conditions.sh index 6a3d6aa..bdc9ad1 100644 --- a/dabo/functions/check_sell_conditions.sh +++ b/dabo/functions/check_sell_conditions.sh @@ -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 ]