Dave-Vallance / bt-ccxt-store

Fork of Ed Bartosh's CCXT Store Work
MIT License
423 stars 187 forks source link

Binance Problem #27

Open Chetchaiyan opened 4 years ago

Chetchaiyan commented 4 years ago

Dear Sir,

I found problem when trying to trade on binance. Here is the following detail.

Error when try to trade buy / sell / order_target the error I found is ccxt.base.errors.ExchangeError: binance {"code":-1104,"msg":"Not all sent parameters were read; read '8' parameter(s) but was sent '9'."}

I look into the code and found out that ccxtbroker._submit add 'created' to params which course this problem. I comment that line out and it's work.

ccxt_order['trades'] is none in ccxtbroker.next binance return ccxt_order with 'trades' key but none value in it which course error Line 199. I check for not null in line 198 and it's work again

Sorry for not issue pull requests, I don't know how to do it. I will try to learn and may be send you a pull requests later.

Best Regards, Chet Chetchaiyan

Dave-Vallance commented 4 years ago

The second issue looks like it was recently introduced. Should be a simple fix to check for the key.

The first issue needs more thought as that is needed for backtesting.

lsps2009 commented 4 years ago

Dear Sir,

I found problem when trying to trade on binance. Here is the following detail.

Error when try to trade buy / sell / order_target the error I found is ccxt.base.errors.ExchangeError: binance {"code":-1104,"msg":"Not all sent parameters were read; read '8' parameter(s) but was sent '9'."}

I look into the code and found out that ccxtbroker._submit add 'created' to params which course this problem. I comment that line out and it's work.

ccxt_order['trades'] is none in ccxtbroker.next binance return ccxt_order with 'trades' key but none value in it which course error Line 199. I check for not null in line 198 and it's work again

Sorry for not issue pull requests, I don't know how to do it. I will try to learn and may be send you a pull requests later.

Best Regards, Chet Chetchaiyan

I have the same problem for living trade on binance. but it don’t work by trying your idea. can you show me the modified code,thanks!

JzINSA commented 4 years ago

I have the same issues.

In bt-ccxt-store/ccxtbt/ccxtbroker.py, comment out : params['created'] = created in def _submit() for the first issue.

In the same file, in the method def next(self), change the following line: if 'trades' in ccxt_order: to if 'trades' in ccxt_order and ccxt_order['trades']!=None:

By doing the above two operations, I got the code working. While waiting for the official fix, this should be sufficient.