more pure bash to speed up things

This commit is contained in:
olli 2023-11-23 10:29:31 +01:00
parent e03394dc0d
commit 9a14cd27a3
2 changed files with 20 additions and 20 deletions

View File

@ -100,7 +100,7 @@ function analyze {
# check_sell_conditions ${g_tmp}/${tmpfile} >>${g_tmp}/output-${tmpfile}
# else
#echo "SELL Checks"
time check_sell_conditions ${g_tmp}/${tmpfile}
check_sell_conditions ${g_tmp}/${tmpfile}
# fi
# fi
# if ! [ -f "${g_tmp}/open-${tmpfile}" ]
@ -110,27 +110,27 @@ function analyze {
# then
# check_buy_conditions ${g_tmp}/${tmpfile} >>${g_tmp}/output-${tmpfile}
# else
time check_buy_conditions ${g_tmp}/${tmpfile}
check_buy_conditions ${g_tmp}/${tmpfile}
# fi
fi
## Chart Part
# local f_intrade=0
# local f_score=${f_buy_score}
# local f_interim="0"
# [ -z "${f_buy_score}" ] && f_buy_score=0
# if [ -z "${f_sell_score}" ]
# then
# f_sell_score=0
# else
# f_score=${f_sell_score}
# f_intrade=1
# if [ -s ${g_tmp}/interim-${tmpfile} ]
# then
# f_interim=$(tail -n1 ${g_tmp}/interim-${tmpfile})
# f_interim=$(g_calc "${f_interim}-${FEE}")
# fi
# fi
# echo "$f_line,${f_market_performance},${f_score},${f_buy_score},${f_sell_score},${f_intrade},${f_interim}" >>analyze-${analyzedate}/chart-${tmpfile}
local f_intrade=0
local f_score=${f_buy_score}
local f_interim="0"
[ -z "${f_buy_score}" ] && f_buy_score=0
if [ -z "${f_sell_score}" ]
then
f_sell_score=0
else
f_score=${f_sell_score}
f_intrade=1
if [ -s ${g_tmp}/interim-${tmpfile} ]
then
f_interim=$(tail -n1 ${g_tmp}/interim-${tmpfile})
f_interim=$(g_calc "${f_interim}-${FEE}")
fi
fi
echo "$f_line,${f_market_performance},${f_score},${f_buy_score},${f_sell_score},${f_intrade},${f_interim}" >>analyze-${analyzedate}/chart-${tmpfile}
## Chart Part End
done

View File

@ -122,7 +122,7 @@ function check_buy_conditions_strategy {
#if [ -s "${f_strategy}" ]
#then
. "${f_strategy}" || return 1
time . "${f_strategy}" || return 1
#else
# g_echo_note "${f_echo_prefix}Strategy file not found"
# return 1