From 191b90a694a0e38dc4b9eb099d41bff3bf7687da Mon Sep 17 00:00:00 2001 From: olli Date: Thu, 1 Jun 2023 09:04:17 +0200 Subject: [PATCH] output if dontt sell while buy condition met --- dabo/functions/check_sell_conditions.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dabo/functions/check_sell_conditions.sh b/dabo/functions/check_sell_conditions.sh index 7f1d08f..6523e8c 100644 --- a/dabo/functions/check_sell_conditions.sh +++ b/dabo/functions/check_sell_conditions.sh @@ -17,7 +17,7 @@ function check_sell_conditions { f_TRADE_HIST_FILE="$(ls -1tr trade-histories/trade-*${f_ASSET}-open.history.csv | tail -n1)" if ! [ -s "${f_TRADE_HIST_FILE}" ] then - g_echo_note "SELL ${f_ASSET}: No trade history file (${f_TRADE_HIST_FILE}) found - ignoring" + g_echo_note "${f_echo_prefix}No trade history file (${f_TRADE_HIST_FILE}) found - ignoring" return 0 fi f_TRADE_HIST_FILE_INTERIM=$(echo ${f_TRADE_HIST_FILE} | sed 's/-open\.history\.csv$/-interim.history.csv/') @@ -39,8 +39,12 @@ function check_sell_conditions { # Check for filled buy conditions - if filled don't sell - check_buy_conditions ${f_ASSET_HIST_FILE} SELL || return 0 - + if ! check_buy_conditions ${f_ASSET_HIST_FILE} SELL + then + g_echo_note "${f_echo_prefix}Buy-Conditions met - Dont Sell" + return 0 + fi + # run strategies local f_strategy_path=../../strategies [ -z "${BOT}" ] && f_strategy_path=strategies