small fixes

This commit is contained in:
2023-06-02 09:53:01 +02:00
parent 08bb049aa1
commit 4c0e8be234
5 changed files with 27 additions and 7 deletions

View File

@@ -120,9 +120,9 @@ do
echo "${file}" | egrep -q "BALANCE|MSCI-WORLD-INDEX" && continue
lines=$(egrep "^${ANALYZE_TIME}" "$file" | grep -v ',,' | wc -l)
if [ $lines -lt 40 ]
if [ $lines -lt 150 ]
then
g_echo "Only $lines lines for given timeframe (${ANALYZE_TIME}) in $file - ignoring files with less then 40!"
g_echo "Only $lines lines for given timeframe (${ANALYZE_TIME}) in $file - ignoring files with less then 150!"
continue
fi

View File

@@ -28,9 +28,15 @@ function check_for_buy {
f_ASSET_HIST_FILE="asset-histories/${f_ASSET}.history.csv"
if [ $(tail -n 6 "$f_ASSET_HIST_FILE" | egrep -v ",,|,$" | wc -l) -ge 5 ]
if [ $(tail -n 155 "$f_ASSET_HIST_FILE" | egrep -v ",,|,$" | wc -l) -ge 150 ]
then
check_buy_conditions "${f_ASSET_HIST_FILE}" "${f_strategy}"
if tail -n1 $f_ASSET_HIST_FILE | grep -q "^$(date +%Y-%m-%d)"
then
g_echo_note "BUY $f_ASSET_HIST_FILE checking conditions"
check_buy_conditions "${f_ASSET_HIST_FILE}" "${f_strategy}"
else
g_echo_note "BUY $f_ASSET_HIST_FILE no current data - ignoring"
fi
else
g_echo_note "BUY $f_ASSET_HIST_FILE not enough data - waiting for complete values"
fi

View File

@@ -22,6 +22,10 @@ function check_for_sell {
do_trade ${f_ASSET} ${CURRENCY} ${f_QUANTITY_CURRENCY} sell "${f_msg}"
continue
fi
if tail -n1 $f_ASSET_HIST_FILE | grep -q "^$(date +%Y-%m-%d)"
then
g_echo_warn "SELL $f_ASSET_HIST_FILE no current data of invested asset"
fi
check_sell_conditions "${f_ASSET_HIST_FILE}" "${f_strategy}"
done
}