yasinkuyu / binance-trader

💰 Cryptocurrency Trading Bot for Binance (Experimental)
2.52k stars 828 forks source link

Float problem #8

Closed bestlinkXx closed 6 years ago

bestlinkXx commented 6 years ago

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'

bestlinkXx commented 6 years ago

Even if I try .get() It doen't work.

yasinkuyu commented 6 years ago

Which symbol?

bestlinkXx commented 6 years ago

I can't put any symbol. I didn't modify your script. That's why it was weird.

bestlinkXx commented 6 years ago

I think it's : WTCBTC

bestlinkXx commented 6 years ago

I think all the problem is here :

File "C:\Users\Julien\Desktop\binance-trader-master\trader.py", line 191, in main() File "C:\Users\Julien\Desktop\binance-trader-master\trader.py", line 170, in main name = raw_input() EOFError: EOF when reading a line

Because we can't input any symbol. That's why we can't catch lastPrice

bestlinkXx commented 6 years ago

Finally I fix problem,

My main problem it's too have correct buying price.

price:0.00031565 buyp:0.00031254 sellp:0.00031596-bid:0.00031253 ask:0.00031597 BTC:$14711.0


Order Id: 11725097 Percentage of 1 profit. Order created from 0.00031596. Profit: 0.00000342 BTC ##################### Target sell price: 0.00031567 Orders Order: 11725097: 0.000312 4.000000 0.000000 Sales were made at 0.00031596 price.

Error: Account has insufficient balance for requested action. [Finished in 101.4s]

Why I don't have same order between 0.00031596 and 0.000312 ?

yasinkuyu commented 6 years ago

https://github.com/yasinkuyu/binance-trader/commit/64fa993c5baa9a22e880814c0d998becf55a2c0b