fix marketCC

This commit is contained in:
olli 2024-11-27 23:49:09 +01:00
parent cd55084d54
commit e1a4bb4a46

View File

@ -26,7 +26,7 @@ function order {
local f_symbol=$1 local f_symbol=$1
local f_amount=$2 # amount in $CURRENCY / if crypto_amount:XXX then amount in crypto local f_amount=$2 # amount in $CURRENCY / if crypto_amount:XXX then amount in crypto
local f_side=$3 # buy/sell long/short local f_side=$3 # buy/sell long/short
local f_price=$4 # price for limit order - if not given do market order local f_price=$4 # price for limit order - if 0 do market order
local f_stoploss=$5 local f_stoploss=$5
local f_takeprofit=$6 local f_takeprofit=$6
local f_params="params={" local f_params="params={"
@ -44,10 +44,9 @@ function order {
[[ $f_side =~ ^buy$|^sell$ ]] || return 1 [[ $f_side =~ ^buy$|^sell$ ]] || return 1
# check order type limit/market # check order type limit/market
if [ -z "$f_price" ] if [[ "$f_price" = "0" ]]
then then
f_type="market" f_type="market"
f_price=0
else else
f_type="limit" f_type="limit"
fi fi