CyberPunkMetalHead / Binance-News-Sentiment-Bot

This is a fully functioning Binance trading bot that takes into account the news sentiment for the top 100 crypto feeds. If you like this project consider donating though the Brave browser to allow me to continuously improve the script.
MIT License
1.57k stars 290 forks source link

For loop in buy doesn't seem to run properly #9

Closed CyberPunkMetalHead closed 3 years ago

CyberPunkMetalHead commented 3 years ago

After some more testing it looks like there's an issue with the for loop inside the buy function.

Below you can see there are 3 coins in the compiled_sentiment though the bot only places a trade for XRP. According to the current logic, the bot should also print a notification saying that the BTC and ETH sentiment or headline volumes are not high enough. Currently working on a fix, but please let me know if you have a solution.

{'XRP': 0.1695, 'BTC': -0.026232, 'ETH': 0.18693333333333337, 'BNB': 0.0} preparing to buy 75.7 XRP with USDT at 1.32147000 order 4343 has been placed on XRP with 75.70000000 at 2021-04-18 20:03:19.198000 and bought at 1.32063000

koraycaglar commented 3 years ago
return bought_at, order

Deleting this line should fix this since it causes to exit from the buy() function, bypassing the for loop.

CyberPunkMetalHead commented 3 years ago

Amazing, that fixed the issue, thanks! :)