fix market
This commit is contained in:
parent
e1a4bb4a46
commit
544fdb2a7a
@ -146,11 +146,15 @@ function order {
|
||||
# calculate price amount precision
|
||||
f_ccxt "print($STOCK_EXCHANGE.amountToPrecision('${f_symbol}', ${f_amount}))"
|
||||
f_amount=$f_ccxt_result
|
||||
if [[ $f_type = limit ]]
|
||||
then
|
||||
f_ccxt "print($STOCK_EXCHANGE.priceToPrecision('${f_symbol}', ${f_price}))"
|
||||
f_price=$f_ccxt_result
|
||||
fi
|
||||
|
||||
# do the order
|
||||
local f_order="symbol='${f_symbol}', type='$f_type', price=$f_price, amount=${f_amount}, side='${f_side}', ${f_params}"
|
||||
[[ $f_type = limit ]] && local f_order="symbol='${f_symbol}', type='$f_type', price=$f_price, amount=${f_amount}, side='${f_side}', ${f_params}"
|
||||
[[ $f_type = market ]] && local f_order="symbol='${f_symbol}', type='$f_type', amount=${f_amount}, side='${f_side}', ${f_params}"
|
||||
echo "$f_order" | notify.sh -s "ORDER"
|
||||
f_ccxt "print($STOCK_EXCHANGE.createOrder(${f_order}))" || return 1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user