diff --git a/dabo/functions/check_for_buy.sh b/dabo/functions/check_for_buy.sh index 9450f11..f5153c6 100644 --- a/dabo/functions/check_for_buy.sh +++ b/dabo/functions/check_for_buy.sh @@ -30,7 +30,7 @@ function check_for_buy { if [ $(tail -n 155 "$f_ASSET_HIST_FILE" | egrep -v ",,|,$" | wc -l) -ge 150 ] then - if tail -n1 $f_ASSET_HIST_FILE | grep -q "^$(date +%Y-%m-%d)" + if tail -n1 $f_ASSET_HIST_FILE | egrep -q "^$(date +%Y-%m-%d)|$(date +%Y-%m-%d -d yesterday)" then g_echo_note "BUY $f_ASSET_HIST_FILE checking conditions" check_buy_conditions "${f_ASSET_HIST_FILE}" "${f_strategy}" diff --git a/dabo/functions/check_for_sell.sh b/dabo/functions/check_for_sell.sh index 6c147d0..2281d1f 100644 --- a/dabo/functions/check_for_sell.sh +++ b/dabo/functions/check_for_sell.sh @@ -18,7 +18,7 @@ function check_for_sell { if [ $(echo "${f_COMPLETE_BALANCE} < ${EMERGENCY_STOP}" | bc -l) -ne 0 ] then local f_msg="ATTENTION! EMERGENCY STOP DUE TO POOR PERFORMANCE: BALANCE (${f_COMPLETE_BALANCE}) LOWER THEN EMERGENCY_STOP-VALUE (${EMERGENCY_STOP})" - g_echo_error "$f_msg" + g_echo_error "${f_msg}" do_trade ${f_ASSET} ${CURRENCY} ${f_QUANTITY_CURRENCY} sell "${f_msg}" continue fi @@ -26,7 +26,9 @@ function check_for_sell { then check_sell_conditions "${f_ASSET_HIST_FILE}" "${f_strategy}" else - g_echo_warn "SELL $f_ASSET_HIST_FILE no current data of invested asset" + local f_msg="SELL $f_ASSET_HIST_FILE no current data of invested asset" + g_echo_warn "${f_msg}" + do_trade ${f_ASSET} ${CURRENCY} ${f_QUANTITY_CURRENCY} sell "${f_msg}" fi done }