Closed who8mypnuts closed 7 years ago
The buy/sell/moveOrder api functions will return different data depending on the type of order ('fillOrKill', etc). Sometimes you will get a 'resultingTrades' field, sometimes not if no trades occured and the order was just posted.
I think the order number is always returned (if the order was posted or traded), you best bet would probably to capture the order number and then check returnOrderTrades and/or returnOpenOrders to get more info on the order.
Interesting take. Thank you for the suggestion. I'll give it a go tomorrow. I have been using a fillOrKill order on this particular one and it's been driving me crazy because the data is there and I can't access it for anything! I can print it out but I can't get to the individual bits.
Thank you again! I'll let you know the result.
When I run a function such as return24hVolume and save to a variable, it's very easy to pull out data.
Something like
works perfectly find and as expected.
Yet, when I run the buy function I cannot pull out the data I need. I constantly get key errors or an indice of int can't be str and so on.
I try something like this:
newAmount = rst['resultingTrades']['total']
I've also tried wrapping this in float, but neither way works.What am I doing wrong/missing? Any help is much appreciated as this is very frustrating.