yasinkuyu / binance-trader

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

Several buy/sell orders until insufficient balance #182

Open diffstorm opened 6 years ago

diffstorm commented 6 years ago

Hi All,

I give it a try and I faced a serious issue. I had already some TRX coins for hold in my account. I tried the bot for just 10000 TRX trade, but it started to put buy orders until it gets insufficient balance error which are 2 orders for my case, then it started to put so many sell orders, which it was selling my holding coins for given price. It put about 21 sell orders consequently. I just stopped the bot then cancelled all orders to prevent lose.

It must work with only the given quantity, it must not buy more than that, it must not sell more than that.

I run it with this change (old value 0.2) WAIT_TIME_CHECK_BUY_SELL = 0.8 # seconds

D:\>python trader.py --stop_loss 0 --symbol TRXBTC --quantity 10000 --profit 0.3
@yasinkuyu, 2018
Auto Trading for Binance.com. --symbol: TRXBTC

...

Started... --quantity: 10000.00000000

0.3% profit scanning for TRXBTC

Between Ask and Bid 0.3% profit hunting
buyp : BuyPrice  (Bid+ --increasing 0.00000001)
sellp: SellPrice (Bid- --decreasing 0.00000001)
...

price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000533 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000533 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000533 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000535 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000535 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000535 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000535 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000535 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000535 sellp:0.00000536-bid:0.00000534 ask:0.00000535
spread:0.19
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000535
spread:0.38
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000535
spread:0.38
price:0.00000534 buyp:0.00000534 sellp:0.00000535-bid:0.00000533 ask:0.00000534
spread:0.19
Buy order created id:26004832, q:10000.00000000, p:0.00000534
Buy order created id:26004834, q:10000.00000000, p:0.00000534
Buy order filled... Try sell...
Buy order filled... Try sell...
Buy order filled... Try sell...
Sell order create id: 26004840
Buy order filled... Try sell...
Sell order create id: 26004844
Buy order filled... Try sell...
Sell order create id: 26004846
Buy order filled... Try sell...
Sell order create id: 26004848
Buy order filled... Try sell...
Sell order create id: 26004851
Buy order filled... Try sell...
Sell order create id: 26004853
Buy order filled... Try sell...
Sell order create id: 26004854
Buy order filled... Try sell...
Sell order create id: 26004856
Buy order filled... Try sell...
Sell order create id: 26004860
Buy order filled... Try sell...
Sell order create id: 26004862
Buy order filled... Try sell...
Sell order create id: 26004865
Buy order filled... Try sell...
Sell order create id: 26004868
Buy order filled... Try sell...
Sell order create id: 26004873
Buy order filled... Try sell...
Sell order create id: 26004875
Buy order filled... Try sell...
Sell order create id: 26004877
Buy order filled... Try sell...
Traceback (most recent call last):
  File "trader.py", line 45, in <module>
    t.run()
  File "./app\Trading.py", line 520, in run
    time.sleep(self.wait_time - (endTime - startTime))
KeyboardInterrupt
Sell order create id: 26004882
Buy order filled... Try sell...
Sell order create id: 26004884
Buy order filled... Try sell...
Sell order create id: 26004885
Buy order filled... Try sell...
m: Account has insufficient balance for requested action.
Buy order filled... Try sell...
m: Account has insufficient balance for requested action.
Buy order filled... Try sell...
m: Account has insufficient balance for requested action.
Buy order filled... Try sell...
Sell order create id: 26004893
m: Account has insufficient balance for requested action.
Sell order create id: 26004896
TonoIdo commented 6 years ago

same

Klaudioz commented 6 years ago

Me too

RO360 commented 6 years ago

same