Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11631

CCXT Take Profit and Stop Loss Error for a Pending Limit Order

$
0
0

I would like to edit a pending order for the inputs of take profit and stoploss (as far as I know it is not possible to perform placing order + take profit + stop loss together with a single command) but while editing I get 'float' object has no attribute 'upper' error. I am a bit new to Python and any help will be highly appreciated.

#-----------------------Get Order ID and Amount-------------------------orders = exchange.fetchOpenOrders('LINKUSDT')for order in orders:    orderId = (order['id'])print(orderId)for order in orders:    qty = float((order['amount']))print(qty)#------------------------------------------------------------symbol = 'LINKUSDT'order_id = orderIdorder_type = 'limit'side = 'sell'amount = qtyprice = 15.000stop_loss = 15.100take_profit = 14.920exchange.edit_order(orderId, symbol, amount, order_type, {'stopLossPrice': stop_loss, 'takeProfitPrice': take_profit})

The output is:

line 47, in <module>    exchange.edit_order(orderId, symbol, amount, order_type, {'stopLossPrice': stop_loss, 'takeProfitPrice': take_profit})line 2222, in edit_order    return self.create_order(symbol, *args)line 2623, in create_order    uppercaseType = type.upper()AttributeError: 'float' object has no attribute 'upper'

Viewing all articles
Browse latest Browse all 11631

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>