yasinkuyu / binance-trader

💰 Cryptocurrency Trading Bot for Binance (Experimental)
2.51k stars 826 forks source link

Partial Fill Buys Race Condition with Sells #178

Open rickdeaconx opened 6 years ago

rickdeaconx commented 6 years ago

I noticed on multiple occasions when a coin is being bought, if it fills slowly (partial fill), the app will issue a sell almost immediately for the partial fill amount without cancelling the remainder of the order.

Ex:

1000 POE Buy 780 POE Fill App issues 780 POE Sell Remaining 220 POE Buy Continues 780 POE Sell Fills App is unaware the 220 POE coins remain

No errors or problems - it just simply isn't aware. There needs to be a wait function or perhaps a partial-fill cancel before the app issues a sell order.

It only seems to happen if the coin fills quickly but slower than immediately. Coins with a long partial fill don't seem to have the problem hence the race condition(I believe).

Can anyone confirm?

ktenman commented 6 years ago

I confirm

lhjk commented 6 years ago

I confirm as well. Maybe there should be a function to check current balance and make sell order of 99%of the balance or something.

AxelDeneu commented 6 years ago

I confirm too