Giter Site home page Giter Site logo

Comments (8)

CyberPunkMetalHead avatar CyberPunkMetalHead commented on June 25, 2024 4

I believe I have found a fix for this as well as the cause of the issue. Binance seems to take a while (sometimes up to 3 seconds until it returns the results of a live order). I have added a while block that will keep on calling the API once every second it returns the order. The output will look something like this

Binance is being slow in returning the order, again the API again... Binance is being slow in returning the order, again the API again... Binance is being slow in returning the order, again the API again... Order returned, saving order to file preparing to buy 110.0 DOCKUSDT

I will shortly commit the changes to the main branch

from binance-volatility-trading-bot.

CyberPunkMetalHead avatar CyberPunkMetalHead commented on June 25, 2024

I'm unable to replicate your issue but could you try changing the way you store information from the last order in the update portfiolio function to be:

            'symbol': orders[coin][-1]['symbol'],
            'orderid': orders[coin][-1]['orderId'],
            'timestamp': orders[coin][-1]['time'],
            'bought_at': last_price[coin]['price'],
            'volume': volume[coin]

Let me know if this fixes your issue

from binance-volatility-trading-bot.

notflip avatar notflip commented on June 25, 2024

@CyberPunkMetalHead I made the changes! I'll let you know if the problem is fixed with that, thank you!

from binance-volatility-trading-bot.

CyberPunkMetalHead avatar CyberPunkMetalHead commented on June 25, 2024

Awesome, keep me updated :)

from binance-volatility-trading-bot.

notflip avatar notflip commented on June 25, 2024

Just out of curiosity, if 0 selects the first index of the array, what does -1 do in python, select the last?

from binance-volatility-trading-bot.

CyberPunkMetalHead avatar CyberPunkMetalHead commented on June 25, 2024

Yep, exactly that :)

from binance-volatility-trading-bot.

goodlifeinc avatar goodlifeinc commented on June 25, 2024

Hi, I am experiencing the same error.
It appears get_all_orders doesn't return the active order since it has already been settled?

2021-05-09 23:33:39: preparing to buy 1.443 ATMUSDT
{
"ATMUSDT": []
}
Traceback (most recent call last):
File "C:\Users\Evgeni\Desktop\crypto\Binance-volatility-trading-bot\Binance Detect Moonings.py", line 304, in
update_porfolio(orders, last_price, volume)
File "C:\Users\Evgeni\Desktop\crypto\Binance-volatility-trading-bot\Binance Detect Moonings.py", line 272, in update_porfolio
'symbol': orders[coin][-1]['symbol'],
IndexError: list index out of range

from binance-volatility-trading-bot.

CyberPunkMetalHead avatar CyberPunkMetalHead commented on June 25, 2024

New commit pushed, this should fix the issue above, feel free to re-open the issue in case it doesn't

from binance-volatility-trading-bot.

Related Issues (20)

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.