Compare commits
No commits in common. "55a27389a2ddedcfdfa0512ffbf0be4145139acc" and "4cbff236800ea80aa5f62900cdb2680bf5051d03" have entirely different histories.
55a27389a2
...
4cbff23680
@ -115,13 +115,7 @@ function get_order_line_vars {
|
||||
[[ $f_order_side = buy ]] && f_type="tp_close_short"
|
||||
[[ $f_order_side = sell ]] && f_type="tp_close_long"
|
||||
fi
|
||||
|
||||
if [ -z "${o[${f_asset}_present]}" ]
|
||||
then
|
||||
o[${f_asset}_present]=${f_type}
|
||||
else
|
||||
o[${f_asset}_present]=${o[${f_asset}_present]},${f_type}
|
||||
fi
|
||||
|
||||
o[${f_asset}_${f_type}_type]=${f_order_array[1]}
|
||||
o[${f_asset}_${f_type}_side]=${f_order_array[2]}
|
||||
o[${f_asset}_${f_type}_entry_price]=${f_order_array[3]}
|
||||
|
@ -116,10 +116,7 @@ function order {
|
||||
echo "$f_order" | notify.sh -s "ORDER"
|
||||
f_ccxt "print($STOCK_EXCHANGE.createOrder(${f_order}))" || return 1
|
||||
|
||||
# refresh orders and positions
|
||||
get_orders "$f_symbol"
|
||||
# refresh positions
|
||||
get_positions
|
||||
get_position_array
|
||||
get_orders_array
|
||||
}
|
||||
|
||||
|
@ -26,32 +26,15 @@ function order_close {
|
||||
local f_order
|
||||
|
||||
get_symbols_ticker
|
||||
get_orders "$f_symbol"
|
||||
get_orders
|
||||
get_orders_array
|
||||
|
||||
local f_asset=${f_symbol//:$CURRENCY/}
|
||||
f_asset=${f_asset//\//}
|
||||
|
||||
if [ -n "${o[${f_asset}_present]}" ]
|
||||
then
|
||||
f_ccxt "print(${STOCK_EXCHANGE}.cancelAllOrders('$f_symbol'))"
|
||||
get_orders "$f_symbol"
|
||||
get_orders_array
|
||||
else
|
||||
g_echo_note "No orders for $f_symbol/$f_asset found"
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
||||
# 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'))"
|
||||
# get_orders "$f_symbol"
|
||||
# get_orders_array
|
||||
# fi
|
||||
# done
|
||||
|
||||
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user