yasinkuyu / binance-trader

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

NameError: name 'sell_price' is not defined #156

Closed DVenerM closed 6 years ago

DVenerM commented 6 years ago

image

rickdeaconx commented 6 years ago

Same Error Buy order created id:3610615, q:950.00000000, p:0.00003614 Buy order partially filled... Wait 1 more second... Order still partially filled... Traceback (most recent call last): File "trader.py", line 46, in t.run() File "./app/Trading.py", line 494, in run self.action(symbol) File "./app/Trading.py", line 378, in action self.sell(symbol, quantity, self.order_id, profitableSellingPrice, lastPrice) File "./app/Trading.py", line 110, in sell quantity = self.check_partial_order(symbol, orderId, sell_price) File "./app/Trading.py", line 281, in check_partial_order if self.min_notional > quantity * sell_price: NameError: global name 'sell_price' is not defined

faztecnyk commented 6 years ago

me i have this error : Profit loss, called order, 4037658 Buy order fail (Not filled) Cancel order... price:0.00013724 buyp:0.00013721 sellp:0.00013926-bid:0.00013720 ask:0.00013750 spread:0.22 price:0.00031809 buyp:0.00031791 sellp:0.00032267-bid:0.00031790 ask:0.00031809 spread:0.06 Exception in thread Thread-21: Traceback (most recent call last): File "/usr/lib64/python2.7/threading.py", line 812, in __bootstrap_inner self.run() File "/usr/lib64/python2.7/threading.py", line 765, in run self.target(*self.args, **self.__kwargs) File "./app/Trading.py", line 141, in sell if self.stop(symbol, quantity, sell_id, last_price): File "./app/Trading.py", line 206, in stop self.cancel(symbol, sell_id) UnboundLocalError: local variable 'sell_id' referenced before assignment

but all the rest is so nice!!!! thank you!

AxelDeneu commented 6 years ago

Same here !

lhjk commented 6 years ago

Using the forked version. Got the same error.

price:11366.29000000 buyp:11352.10000000 sellp:11374.76412000-bid:11352.06000000 ask:11374.91000000 Buy order created id:28168085, q:0.00200000, p:11352.10000000 Buy order partially filled... Wait 1 more second... Order still partially filled... Traceback (most recent call last): File "trader.py", line 46, in t.run() File "./app/Trading.py", line 494, in run self.action(symbol) File "./app/Trading.py", line 378, in action self.sell(symbol, quantity, self.order_id, profitableSellingPrice, lastPrice) File "./app/Trading.py", line 110, in sell quantity = self.check_partial_order(symbol, orderId, sell_price) File "./app/Trading.py", line 281, in check_partial_order if self.min_notional > quantity * sell_price: NameError: global name 'sell_price' is not defined

walruzperil commented 6 years ago

Yes, i try all night trade with stop loss. Bot buy and error quit, no stop loss set. Lose some BTC :) waiting fix it..

DVenerM commented 6 years ago

replace 'def check_partial_order(self, symbol, orderId, price):' on 'def check_partial_order(self, symbol, orderId, sell_price):'

walruzperil commented 6 years ago

@DVenerM , still get error: Buy order created id:5512723, q:20.00000000, p:0.00071000 m: UNKNOWN_ORDER Profit loss, called order, 5512723 Buy order fail (Not filled) Cancel order... Binance server delayed! Try sell... Sell order create id: 5512847 Not sold after 5 seconds, wait 5 more seconds... Profit loss, called order, 5512847 m: Filter failure: PRICE_FILTER Traceback (most recent call last): File "trader.py", line 46, in t.run() File "./app/Trading.py", line 494, in run self.action(symbol) File "./app/Trading.py", line 378, in action self.sell(symbol, quantity, self.order_id, profitableSellingPrice, lastPrice) File "./app/Trading.py", line 159, in sell self.stop(symbol, quantity, sell_id, sell_price) File "./app/Trading.py", line 216, in stop sell_id = sello['orderId'] KeyError: 'orderId'

DVenerM commented 6 years ago

@walruzperil this is another error

AxelDeneu commented 6 years ago

@DVenerM Tested on my side, doesn't have any error atm

walruzperil commented 6 years ago

@DVenerM , maybe you know what tihs error?

AxelDeneu commented 6 years ago

@walruzperil Are you on master branch ? Which parameters are you using ?

walruzperil commented 6 years ago

@AxelDeneu, i use @WeSpeakCrypto version, parameters like: python trader.py --symbol ICXBTC --quantity 20 --profit 0.7 --wait_time 0.5 --increasing 0.00000005 --decreasing 0.00000031 --stop_loss 1.5

AxelDeneu commented 6 years ago

@walruzperil Is it occuring each time you have a buy order ?

walruzperil commented 6 years ago

@AxelDeneu Nope, sometimes, maybe 1 from 10. Order buyed, then try set sell order or stoplose(?), and error...

AxelDeneu commented 6 years ago

@walruzperil This is strange, open a new issue, because you doesn't have the same issue as @DVenerM

DVenerM commented 6 years ago

@walruzperil I don't know

rickdeaconx commented 6 years ago

This worked:

replace 'def check_partial_order(self, symbol, orderId, price):' on 'def check_partial_order(self, symbol, orderId, sell_price):'

kfiresmith commented 6 years ago

Thanks @rickdeaconx - created a new PR with this fix.

kfiresmith commented 6 years ago

Nevermind - someone else already has a PR in to be merged to fix this. You can track the fix for this problem here:

https://github.com/yasinkuyu/binance-trader/pull/164

yasinkuyu commented 6 years ago

fixed https://github.com/yasinkuyu/binance-trader/pull/164

TonoIdo commented 6 years ago

@faztecnyk Hey what did you do to resolve that error? I'm getting the same thing.