From fa6dd0741761dcb1b611c78a342e6704beeef64f Mon Sep 17 00:00:00 2001 From: olli Date: Fri, 30 Aug 2024 17:32:27 +0200 Subject: [PATCH] cancel orders --- dabo/functions/order_cancel.sh | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 dabo/functions/order_cancel.sh diff --git a/dabo/functions/order_cancel.sh b/dabo/functions/order_cancel.sh new file mode 100644 index 0000000..db05f1f --- /dev/null +++ b/dabo/functions/order_cancel.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# Copyright (c) 2022-2024 olli +# +# This file is part of dabo (crypto bot). +# +# dabo is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# dabo is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with dabo. If not, see . + + +function order_close { + # Info for log + g_echo_note "RUNNING FUNCTION ${FUNCNAME} $@" + + local f_symbol=$1 + local f_order + + get_symbols_ticker + get_orders + get_orders_array + + for f_order in "${f_get_orders_array[@]}" + do + get_order_line_vars "$f_order" + if [ "$f_symbol" = "$f_order_symbol" ] + then + f_ccxt "print(${STOCK_EXCHANGE}.cancelAllOrders('$f_symbol'))" + fi + done +}