analyze 2 analyze
This commit is contained in:
parent
1423fdbe71
commit
3b1873616c
@ -119,30 +119,27 @@ function analyze {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$f_BUY" ]
|
||||
set -x
|
||||
if [ -n "${f_BUY}" ]
|
||||
then
|
||||
set -x
|
||||
echo "BUY: ${f_BUY}"
|
||||
f_open_trade=1
|
||||
BUY_PRICE=$f_price
|
||||
f_BUY=""
|
||||
set +x
|
||||
fi
|
||||
set +x
|
||||
|
||||
if [ -n "${f_SELL}" ]
|
||||
then
|
||||
set -x
|
||||
echo "SELL: ${f_date} ${f_SELL}"
|
||||
g_percentage-diff ${BUY_PRICE} ${f_price}
|
||||
g_calc "${g_percentage_diff_result}-${FEE}"
|
||||
result=${g_calc_result}
|
||||
echo "${result}" >>${g_tmp}/result-${tmpfile}
|
||||
rm -f "${f_TRADE_HIST_FILE}"
|
||||
rm -f "${f_TRADE_HIST_FILE_INTERIM}"
|
||||
unset f_open_trade
|
||||
echo "RESULT: ${result}% (${BUY_PRICE} -> ${f_price})"
|
||||
set +x
|
||||
fi
|
||||
# if [ -n "${f_SELL}" ]
|
||||
# then
|
||||
# echo "SELL: ${f_date} ${f_SELL}"
|
||||
# g_percentage-diff ${BUY_PRICE} ${f_price}
|
||||
# g_calc "${g_percentage_diff_result}-${FEE}"
|
||||
# result=${g_calc_result}
|
||||
# echo "${result}" >>${g_tmp}/result-${tmpfile}
|
||||
# rm -f "${f_TRADE_HIST_FILE}"
|
||||
# rm -f "${f_TRADE_HIST_FILE_INTERIM}"
|
||||
# unset f_open_trade
|
||||
# echo "RESULT: ${result}% (${BUY_PRICE} -> ${f_price})"
|
||||
# fi
|
||||
|
||||
|
||||
## Chart Part
|
||||
|
@ -44,11 +44,11 @@ function check_buy_conditions {
|
||||
done
|
||||
|
||||
# if this checks came from sell function
|
||||
if [ "$2" == "SELL" ]
|
||||
then
|
||||
[ -n "$f_BUY" ] && return 1
|
||||
return 0
|
||||
fi
|
||||
#if [ "$2" == "SELL" ]
|
||||
#then
|
||||
# [ -n "$f_BUY" ] && return 1
|
||||
# return 0
|
||||
#fi
|
||||
|
||||
### Buy or not buy?
|
||||
# BOT
|
||||
|
Loading…
Reference in New Issue
Block a user