Git Product home page Git Product logo

binance-trader's Introduction

binance-trader's People

Contributors

2pd avatar fieu avatar jramos avatar justfordev2020 avatar koujun2012 avatar omerfarukz avatar piscue avatar plgonzalezrx8 avatar rxcod9 avatar yasinkuyu avatar ykartal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

binance-trader's Issues

TypeError: Unicode-objects must be encoded before hashing

TypeError: Unicode-objects must be encoded before hashing

Traceback (most recent call last):
12/23/2017 3:28:19 PM  File "./trader.py", line 217, in <module>
12/23/2017 3:28:19 PM    main()
12/23/2017 3:28:19 PM  File "./trader.py", line 210, in main
12/23/2017 3:28:19 PM    action(symbol)
12/23/2017 3:28:19 PM  File "./trader.py", line 160, in action
12/23/2017 3:28:19 PM    ORDER_ID = buy_limit(symbol, QUANTITY, buyPrice)
12/23/2017 3:28:19 PM  File "./trader.py", line 44, in buy_limit
12/23/2017 3:28:19 PM    ret = client.buy_limit(symbol, quantity, buyPrice)
12/23/2017 3:28:19 PM  File "/app/BinanceAPI.py", line 50, in buy_limit
12/23/2017 3:28:19 PM    return self._post(path, params)
12/23/2017 3:28:19 PM  File "/app/BinanceAPI.py", line 116, in _post
12/23/2017 3:28:19 PM    query = urlencode(self._sign(params))
12/23/2017 3:28:19 PM  File "/app/BinanceAPI.py", line 100, in _sign
12/23/2017 3:28:19 PM    signature = hashlib.sha256(h).hexdigest()
12/23/2017 3:28:19 PMTypeError: Unicode-objects must be encoded before hashing

Problem to sell

Hello,

I have a problem to execute this condition :

for order in ret:
price = float(order['price'])
origQty = float(order['origQty'])
executedQty = float(order['executedQty'])

    if order['orderId'] == orderId:
        print ("Order: %d: %lf\t%lf\t%lf" % (order['orderId'], price, origQty, executedQty))
 
        TARGET_PROFITABLE_PRICE = None
        ORDER_ID = 0

Condition : order['orderId'] == orderId is impossible to achieve.

Anyone has a solution please ?

What's the correct logic for trader bot? (Discussion)

I am wondering what's the correct logic for a simple trader bot.

IMO. Tracking order is not very efficient and can introduce some serious issue.

Should we have some strategy to stop bleeding when the price drop and buy again after dropping below a certain level? And for price surge, we probably should do something similar.

Error: UNKNOWN_ORDER

@yasinkuyu, 2017
Auto Trading for Binance.com (Beta). Enter your symbol. Ex: TRXBTC

trader.py --quantity 500 --symbol TRXBTC --profit 0.3 --wait_time 1 --orderid 0

%0.3 profit scanning for TRXBTC

price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.9
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.9
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.9
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.9
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.9
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.9
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.9
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.9
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.9
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.9
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15971.2
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15971.2
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15971.2
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15990.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15990.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15990.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15976.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15970.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15970.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15970.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15970.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15970.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15961.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15961.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15961.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15969.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15965.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15969.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15961.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15961.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15961.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15955.5
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15969.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15969.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15969.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15969.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15990.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15993.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15961.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15961.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15961.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15961.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15961.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15961.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15950.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15989.9
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15974.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15989.9
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15989.9
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15989.7
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15989.7
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15989.7
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15989.7
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15989.7
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15989.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15989.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15978.4
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15978.4
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15978.3
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15978.3
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15978.3
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15978.2
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15978.2
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15978.2
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15978.2
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15978.2
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15978.2
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15978.2
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15978.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15978.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15978.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15977.9
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15977.9
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15977.9
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15977.9
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15977.9
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15977.9
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15969.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15977.9
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15969.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15977.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15977.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15977.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15977.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15969.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15969.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15951.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15977.9
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15980.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15950.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15976.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15976.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15976.0
price:0.00000223 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15976.0
price:0.00000224 buyp:0.00000225 sellp:0.00000224-bid:0.00000224 ask:0.00000225 BTC:$15976.0
price:0.00000224 buyp:0.00000225 sellp:0.00000224-bid:0.00000224 ask:0.00000225 BTC:$15976.0
price:0.00000224 buyp:0.00000225 sellp:0.00000224-bid:0.00000224 ask:0.00000225 BTC:$15976.0
price:0.00000224 buyp:0.00000225 sellp:0.00000224-bid:0.00000224 ask:0.00000225 BTC:$15976.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15976.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15980.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15980.0
price:0.00000224 buyp:0.00000224 sellp:0.00000223-bid:0.00000223 ask:0.00000224 BTC:$15980.0
price:0.00000225 buyp:0.00000224 sellp:0.00000224-bid:0.00000223 ask:0.00000225 BTC:$15988.0
******************
Order Id: 4387195
Percentage of 0.3 profit. Order created from 0.00000224. Profit: 0.00000000 BTC
#####################
4387195 Order complated. Try sell...
Target sell price: 0.00000225
Orders
4387195 Order complated. Try sell...
4387195 Cancel order
Error: UNKNOWN_ORDER

Whats is it ? help pls

`try:

m = Binance()
#m.balances()
m.orders('TRXBTC',1)`

TypeError: function takes exactly 1 argument (3 given)

Hi thanks for the great code, bot works but when it buyes a share gives error and exits code, i start again but same, allways it buyes but couln't sell anyway for crashing.

i make test for BNBETH

do@dotrader:~/Downloads/binance-trader-master$ python trader.py
@yasinkuyu, 2017
Auto Trading for Binance.com (Beta). Enter your symbol. Ex: IOTABTC
BNBETH
%1.3 profit for scanning BNBETH

price:0.00840000 buyp:0.00810913 sellp:0.00819744-bid:0.00810903 ask:0.00819754 BTC:$19508.1

price:0.00840000 buyp:0.00810913 sellp:0.00819744-bid:0.00810903 ask:0.00819754 BTC:$19478.5

price:0.00840000 buyp:0.00810913 sellp:0.00819744-bid:0.00810903 ask:0.00819754 BTC:$19503.3

price:0.00840000 buyp:0.00810913 sellp:0.00819744-bid:0.00810903 ask:0.00819754 BTC:$19482.0

price:0.00842334 buyp:0.00810913 sellp:0.00819990-bid:0.00810903 ask:0.00820000 BTC:$19480.0

price:0.00842334 buyp:0.00815010 sellp:0.00819990-bid:0.00815000 ask:0.00820000 BTC:$19480.0

price:0.00830675 buyp:0.00815010 sellp:0.00819990-bid:0.00815000 ask:0.00820000 BTC:$19482.0

price:0.00830675 buyp:0.00815010 sellp:0.00819990-bid:0.00815000 ask:0.00820000 BTC:$19482.0

price:0.00842333 buyp:0.00815010 sellp:0.00823917-bid:0.00815000 ask:0.00823927 BTC:$19480.2

price:0.00842334 buyp:0.00815010 sellp:0.00823918-bid:0.00815000 ask:0.00823928 BTC:$19480.2

price:0.00842334 buyp:0.00810913 sellp:0.00823918-bid:0.00810903 ask:0.00823928 BTC:$19480.2
Traceback (most recent call last):
  File "trader.py", line 181, in <module>
    main()
  File "trader.py", line 174, in main
    action(symbol)
  File "trader.py", line 139, in action
    buy_limit(symbol, QUANTITY, buyPrice)
  File "trader.py", line 41, in buy_limit
    file.write(ORDER_ID,QUANTITY,buyPrice) 
TypeError: function takes exactly 1 argument (3 given)

feature: add step-profit

Hi,

will be very nice to set step-profit so if it reaches the desired profit %, it monitors and if % goes higher, it will ride it and only sell once it drops to or slightly below the set profit.

so if i set 1.5% profit, it will not sell at 1.5% if price increases, only if it drops to 1.4-1.3 it will sell. or have a setting to determine step.

Not buying

Can someone tell me why it's not buying anything?

Tried different variants:

Profit Quantity Symbol  
1.3 6 IOTABTC  
1.3 10 IOTABTC  
0.5 6 XVGBTC  
0.5 60 XVGBTC  
0.5 600 XVGBTC (window closed after ~45 sec)
0.1 600 XVGBTC (window closed after ~5 sec)
1 400 XVGBTC  
1 400 TRXBTC  
1 1000 TRXBTC  
0.5 1000 TRXBTC  
0.1 1000 TRXBTC (window closed after ~50 sec)
1 2000 TRXBTC  

Account balance
BTC | 0.00977471 |  

11111111111111111111111111

Bot increase speed

Hello everyone,

I need to know how is it possible to increase speed of this algorithm to buy/sell faster and improve profit to take best buyPrice.

Thank you !

Bot no Buy/Sell

when it seems it is going to make order it tells me

Error : Filter failure: Price_Filter

Thank you for your work

Can I Exclude specific coins?

I'm holding TRX and want to save it for the long run. Will this bot auto sell it as i already have it assigned on my account?

IOTABTC

I think one of the issues with the bot that conflicts with binance, is that when the bot says it buys 6 iota for instance, in reality, it's buying around 5.9, so when it goes to sell, it comes up with an insufficient funds error. We need to add a way for the bot to buy slightly more than it's setting out to buy, in order to actually put it at 6 iota instead of 5.9 or 5.8

Stuck at saying "sell try again" instead of Selling

Hey,

First of all wanna say that it is an amazing bot that has been build, and would like to say a huge thanks to Yasinkuyu.

The bot works fine with buying but has a problem when selling, and instead says "... sell try again...", anyone else have this problem? and know how to fix it?

Thank you so much on beforehand :)

Error: Filter failure: PRICE_FILTER

Merhaba Yasin,

Hesabımda 2.59149360 BNB var, LTC almak istiyorum. Aşağıdaki kodu çalıştırdığımda

" Error: Filter failure: PRICE_FILTER " hatası almaktayım. Nasıl düzeltmem gerekiyor.

python2.7 trader.py --symbol LTCBNB --quantity 2 --profit 1.5

KeyError: 'lastPrice'

%0.5 profit scanning for IOTAWTC
Traceback (most recent call last):
File "trader.py", line 210, in
main()
File "trader.py", line 203, in main
action(symbol)
File "trader.py", line 129, in action
lastPrice = get_ticker(symbol)
File "trader.py", line 113, in get_ticker
return float(ret["lastPrice"])
KeyError: 'lastPrice'

Error using python everywhere

Do I need to use Docker?

(Caused by ProxyError('Cannot connect to proxy.', error(
'Tunnel connection failed: 403 Forbidden',)))

Error: Filter failure: LOT_SIZE

I have a bit modified my code but is giving an error, it would be great if someone can help...

sell_limit(symbol, 0.004995, 13658707)

def sell_limit(symbol, quantity, orderId):
global TEST_MODE
global ORDER_ID
global TARGET_PRICE
global TARGET_PROFITABLE_PRICE
global TARGET_PRICE

TARGET_PRICE = 0.206795

ret = client.sell_limit(symbol, quantity, TARGET_PRICE)

if 'msg' in ret:
errexit(ret['msg'])
The code gives error on sell_limit() when I try to create order.

Error: Filter failure: LOT_SIZE

Can you suggest me what would be the reason?

TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'

Hello,

I'd like to run your bot, but I get following error:

@yasinkuyu, 2017
Auto Trading for Binance.com. --symbol: XVNBTC
trader.py --symbol XVNBTC --quantity 1 --profit 1.3 --wait_time 1 --orderid 0

%1.3 profit scanning for XVNBTC
...

'lastPrice'
'lastPrice'
'lastPrice'
'bids'
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "trader.py", line 320, in action
buyPrice = lastBid + option.increasing
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float'

What to do? I'm not very good at python and linux :)

Insecure Platform Warning

Why am I getting this error? I finally got it to run and got requests installed, but now it's giving me this when I run it and from what I've noticed, it hasn't been buying or selling, but is pulling the correct IOTABTC prices. I'm on Windows 7 btw.

untitled

Bot Not Doing Anything?

Hi, I'm new to this. I got python and the pip install requests set up. I ran the bot and enter the ticker. Bot ran and just list what your screenshot in the readme. It doesn't do anything. Could you elaborate on what it suppose to be doing?

price: x.xxxxxx buyp: x.xxxxxx sellp: x.xxxxxx bid: x.xxxxxx ask: x.xxxxxx

What is the price? I'm assuming it's what the current price of the ticker.
What is buyp? I'm guessing it is a predetermined price calculated to get the profit %?
What is sellp? Selling price to make the profit %?
bid?
ask?

Thank you.

help

i received this error

Traceback (most recent call last):
File "/Users/SoleATCService/Desktop/binance-trader-master/trader.py", line 216, in
main()
File "/Users/SoleATCService/Desktop/binance-trader-master/trader.py", line 209, in main
action(symbol)
File "/Users/SoleATCService/Desktop/binance-trader-master/trader.py", line 129, in action
file = open("ORDER", "r")
IOError: [Errno 2] No such file or directory: 'ORDER'

How Do I Get This Working In Windows And Getting Requests

So I've managed to run the program using the idle.bat from Python 2.7 (Then using F5 to run it), but whenever I run it, it says that there is no module called requests. I saw a way to install them, but those are with linux commands. How do I get Requests for Windows? Also, is there anything I need to edit besides adding API keys to config.py?

AttributeError: BinanceAPI instance has no attribute 'market_buy'

Hi I have 2 errors:
could you help please?

first:

price:0.00040996 buyp:0.00040997 sellp:0.00041484-bid:0.00040996 ask:0.00040997
Order(buy): DNTETH id:4839429, price: 0.00040393, orig_qty: 30.00000000
price:0.00040996 buyp:0.00040997 sellp:0.00041484-bid:0.00040996 ask:0.00040997
Profit loss, called order, 4839429
Exception in thread Thread-140:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "trader.py", line 212, in check_buy
buy = client.market_buy(symbol, quantity)
AttributeError: BinanceAPI instance has no attribute 'market_buy'

second:

Order(buy): DNTETH id:4830476, price: 0.00037251, orig_qty: 30.00000000
price:0.00038000 buyp:0.00037254 sellp:0.00037707-bid:0.00037253 ask:0.00038000
Error: UNKNOWN_ORDER
Order Id: 4830504
Order(buy): DNTETH id:4830480, price: 0.00037253, orig_qty: 30.00000000
price:0.00037250 buyp:0.00037255 sellp:0.00037708-bid:0.00037254 ask:0.00038000
Exception in thread Thread-282:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda2\lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "C:\ProgramData\Anaconda2\lib\threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "trader.py", line 122, in sell_limit
print ("Profit: %%%s. Buy: %.8f Sell: %.8f" % (PROFIT, buyPrice, sell_price))
##NameError: global name 'buyPrice' is not defined

get_ticker giving old information and stays the same

the get_ticker function is giving old information, and it stays the same for example:

price:0.00000340 buyp:0.00000541 sellp:0.00000540-bid:0.00000540 ask:0.00000541 BTC:$17449.9
price:0.00000340 buyp:0.00000541 sellp:0.00000540-bid:0.00000540 ask:0.00000541 BTC:$17449.9

price for XVGBTC at the time is actually .00000539
price for BTCUSDT at the time is 17011

how to solve this?

Traceback (most recent call last):
File "trader.py", line 216, in
main()
File "trader.py", line 209, in main
action(symbol)
File "trader.py", line 132, in action
lastPrice = get_ticker(symbol)
File "trader.py", line 116, in get_ticker
return float(ret["lastPrice"])
KeyError: 'lastPrice'

Filter Failure

New error popped up.

image

Currently trying to work on the issue #10
I'll check that later.

Asynchronous between wallet and trade market

Hello everyone,

The firstly, I very thanks to @yasinkuyu because create a good bot for binance. It's work good although there are some minor bugs.

I have a bug, I was trade with auto bot, and buy EOS-BTC with bot success, but can't sell by script becauce error messenger is ".. sell try again.." , and I manually sell it and fininshed trade history.
[]http://prntscr.com/hvdtw1

When I view at wallet, I look it available EOS in balance with status In Order. []http://prntscr.com/hvdupc

In Trade Market, do not have any order.
[]http://prntscr.com/hvdvcb

How to fix it ?

ILEGAL CHARACTERS FOUND

price:0.00005940 buyp:0.00005905 sellp:0.00005984-bid:0.00005904 ask:0.00005985 BTC:$14232.0
Error: Illegal characters found in parameter 'price'; legal range is '^([0-9]{1,20})(.[0-9]{1,20})?$'.

i keep getting this error for some reason i cant explain.
@yasinkuyu

Float problem

Hi, How is it possible to fix this problem ?

File "C:\Users\Julien\Desktop\binance-trader-master\trader.py", line 117, in action
lastPrice = get_ticker(symbol)
File "C:\Users\Julien\Desktop\binance-trader-master\trader.py", line 101, in get_ticker
return float(ret["lastPrice"])
KeyError: 'lastPrice'

Poor python logic/scripting + bug + suggestion

Not to offend anyone, i like the idea of the script.

But: to start off, you're current main(): fails

name=raw_input() <----------- makes no sense because "--symbol"; This causes the script to break!
Remove it AND the if name != statement, and the script works again.

while True <-------- while what True??? this way, its alway's true.....dafuq? :P

Second:

Define globals outsite of functions, they are globals.... put them at the top
e.g.

#Define Python imports
import os
import sys
import time
import config
import argparse

#Define Custom imports
from BinanceAPI import *

#Define Custom import vars
client = BinanceAPI(config.api_key, config.api_secret)

#Set globals
global DEBUG_MODE
global TEST_MODE

#Set parser
parser = argparse.ArgumentParser()
parser.add_argument("--quantity", type=float, help="Buy/Sell Quantity", default=6)
parser.add_argument("--symbol", type=str, help="Market Symbol (Ex: IOTABTC)", default='IOTABTC')
parser.add_argument("--profit", type=float, help="Target Profit", default=1.3)
parser.add_argument("--orderid", type=int, help="Target Order Id", default=0)
parser.add_argument("--testmode", type=bool, help="Test Mode True/False", default=False)
parser.add_argument("--debug",type=bool, help="Script debug mode True/False", default=False)
parser.add_argument("--wait_time", type=int, help="Wait Time (seconds)", default=3)
parser.add_argument("--increasing", type=float, help="Buy Price +Increasing (0.00000001)", default=0.00000001)
parser.add_argument("--decreasing", type=float, help="Sell Price -Decreasing (0.00000001)", default=0.00000001)
option = parser.parse_args()

#Define parser vars
TEST_MODE = option.testmode
DEBUG_MODE = option.debug
PROFIT = option.profit
ORDER_ID = option.orderid
QUANTITY = option.quantity
WAIT_TIME = option.wait_time # seconds
WAIT_TIME_SELL = 4 # seconds

Third:

Might want to add a --debug option for output testing/verification

Let us know its on or off
if DEBUG_MODE:
print("DEBUG_MODE = ON.")
else:
print("DEBUG_MODE = OFF")

my 2 cents! Goodluck =D

Unknown Order Error

Happened just a bit ago. The script made a buy, but then an error popped up saying it was an Unknown Order and then killed the process. The buy went through, but the process killed itself after it made the buy.

Bot is buying but not selling?

First of all, thanks for making this script!

I have done everything like described, I can see the bot buying sometimes but it wont sell.
Ive put the percentage on 1.3 - quantity on 100, and did wait for a long while, but it never did sell anything.

Purchase with error

Script purchases but fails to see it properly.
screen shot 2018-01-05 at 12 41 40 am

then continues to try to drain all funds continuously purchasing over and over, instead of selling.
screen shot 2018-01-05 at 12 44 14 am

Path problem on Sublim text

Hello,

I have this problem :

[Decode error - output not utf-8]
[cmd: [u'python', u'-u', u'C:\Users\Julien\Desktop\binance-trader-master\trader.py']]
[dir: C:\Users\Julien\Desktop\binance-trader-master]
[path: C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Program Files (x86)\AMD APP\bin\x86_64;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files (x86)\Skype\Phone;C:\Program Files (x86)\Windows Live\Shared;C:\Python36;]
[Finished]

I don't know how to fix PATH problem ?

Thank you

request missing

from BinanceAPI import *
File "/Users/ambhaiji/Downloads/binance-trader-master/BinanceAPI.py", line 3, in
import requests
ImportError: No module named requests

Sample Code for market order

I have made a change in the code and have placed market Buy order instead of limit order.
But after getting Order ID, I am not able to get price at which the coin is bought. Can anyone help me in giving me the sample code?
Thanks!!

setup HELP!

Hi,
i am having some issues setting this bot up ( i do not have any experience setting something up with python) so i downloaded the folder from github and changed the config.py to:

api_key = My binance api key
api_secret = My binance api secret
recv_window = 6000000

i have installed python via this site: https://www.python.org/download/releases/2.7/
but i dont understand what i have to do further:
the requirements, do i write them in the config file?
what do i have to do with de pip install? and import... , do i type that in the python application?
Python is in a different folder then the downloaded github folder do they have to be in the same folder?
are there any other things i have to think about?

i am sorry if these are noob questions ( i think they are :/)
thanks in advance

Closing

In test mode bot close the window after buying
333333333333333

in normal mode bot close the window when he needs to buy.

What's the problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.