CodeReclaimers / btce-api

Python wrapper around the public and trading APIs of BTC-e.com
MIT License
191 stars 123 forks source link

"Buy" trade does not return order_id #16

Closed seanbaker74 closed 11 years ago

seanbaker74 commented 11 years ago

The order_id keeps getting returned as "0" when I buy. Selling is no problem. Is this expected?

alanmcintyre commented 11 years ago

Thank you for reporting this, I'll have a look.

alanmcintyre commented 11 years ago

The order_id you get is what the server returns, so I can't do much about it, but here's the pattern I noticed while writing bots: if your order fills completely, then the returned order_id is 0; otherwise, you get the order_id of the remaining portion of your order that is unfilled. (See _attemptBuy/Sell in the "Hello World!" bot.)

Apologies for taking so long to get back to this! If you have any further questions or problems please feel free to reopen the issue.

netaneld122 commented 11 years ago

I'm having the same issue but your answer did not satisfy me. The server response for a placement of a limit order is instant, and therefore can not represent whether the order was filled completely or partially, it would make no sense to return order_id:0 whatsoever, in any case. I think it's a real bug and I reported it to BTC-E.