From 21125e84e51d33c01056439f2c9a341503c7a57c Mon Sep 17 00:00:00 2001 From: olli Date: Mon, 16 Dec 2024 16:40:29 +0100 Subject: [PATCH] fix typo --- dabo/functions/get_positions.sh | 5 +++-- dabo/functions/order.sh | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dabo/functions/get_positions.sh b/dabo/functions/get_positions.sh index d5cea99..fa356bc 100644 --- a/dabo/functions/get_positions.sh +++ b/dabo/functions/get_positions.sh @@ -145,8 +145,9 @@ function get_position_line_vars { f_position_takeprofit_price=${f_position_array[7]} fi - printf -v f_position_asset_amount %.2f ${f_position_array[8]} - p[${f_asset}_asset_amount]=$f_position_asset_amount + #printf -v f_position_asset_amount %.2f ${f_position_array[8]} + #p[${f_asset}_asset_amount]=$f_position_asset_amount + p[${f_asset}_asset_amount]=${f_position_array[8]} # calc pnl percentage if [[ $f_position_side = long ]] diff --git a/dabo/functions/order.sh b/dabo/functions/order.sh index f4f2b03..0f5b61d 100644 --- a/dabo/functions/order.sh +++ b/dabo/functions/order.sh @@ -147,7 +147,8 @@ function order { # stoploss (change) for open position elif [[ $f_type = "stoploss" ]] then - f_params="${f_params}'reduceOnly': True, 'triggerPrice': $f_stoploss, 'triggerDirection': 'down', 'type': 'market'" + f_type="market" + f_params="${f_params}'reduceOnly': True, 'triggerPrice': $f_stoploss, 'triggerDirection': 'down', 'type': '$f_type'" fi fi if [ -n "$f_takeprofit" ] @@ -172,7 +173,8 @@ function order { [[ $f_type =~ limit|market ]] && f_params="${f_params}'takeProfit': { 'triggerPrice': $f_takeprofit, 'type': 'limit', 'price': $f_takeprofit, }, " if [[ $f_type = "takeprofit" ]] then - f_params="${f_params}'reduceOnly': True, 'triggerPrice': $f_takeprofit, 'triggerDirection': 'up', 'type': 'limit'" + f_type="limit" + f_params="${f_params}'reduceOnly': True, 'triggerPrice': $f_takeprofit, 'triggerDirection': 'up', 'type': '$f_type'" fi fi