chrisleekr / binance-trading-bot

Automated Binance trading bot - Trade multiple cryptocurrencies. Buy low/sell high with Grid Trading. Integrated with TradingView technical analysis

Home Page:https://binance-trading-bot-chrisleekr.cloud.okteto.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Infinite remove last buy price loop if rest of grid trades removed

uhliksk opened this issue · comments

Version

v0.0.96

Description

When rest of grid trades after already executed ones are removed and stop-loss is triggered, it will cause infinite loop of trailingTrade crashes trying to remove last buy price.

To Reproduce

  1. Add 15 grid trades.
  2. Wait until 10 grid trades are executed.
  3. Open symbol settings.
  4. Wait for 11th buy grid trade order is opened in background.
  5. Remove last 5 grid trades while 11th buy grid trade order is still opened.
  6. Bot will try to write closed order in non-existing grid trade causing an infinite loop.

Expected Behaviours

It should remove last buy price.

Screenshots

image

Additional context

@uhliksk, any chance you found the root cause?

@chrisleekr I don't know yet but I found another bug while hunting this one. I'll create issue and PR today. :)

Edit: Maybe tommorow as yet I'm pretty good to reproduce bug with missing buy orders but still I'm not sure about the exact reproductions steps as I'm still hunting which parameter is actually causing buy order is opened without it recorded in the grid trade.

image

@chrisleekr I found this one #583. I'll edit reproduction steps as there is another condition to get it crashed.

Sometimes there is a big difference between what I think I've done and what I've really done before the bug occured. :)

commented

Hi, i confirm i have the same issues,
infinite price removal for all symbol,

(i have only one setup buy and 1 sell grid ever configure)

log for a random sybol

01:40:14.848 97e36f783e78 - remove-last-buy-priceBalance is not enough to sell. Delete last buy price.

@uhliksk @rando128 @habibalkhabbaz
Sorry for random issue with leaving the message.

I am considering releasing a new version to prepare my PR #539.

Are any fixes pending for this release?

Hi @chrisleekr, I'm working on a chore PR to move the next best grid amount calculations into the backend to have a cleaner front implementation (in preparation for a future functional improvement). It should be ready during the weekend. You can release before if you want though.

@rando128 👍 I can wait! Let me know!

Now I think I should've opened new issue, not using this issue. Sorry @uhliksk I won't do next time.

@chrisleekr No problem. I'm also working on PR to fix #594, but I was busy last few weeks and didn't finished it yet. If you can wait, I'll prepare it for next week.

Nice @uhliksk thanks! I will wait. :)

Hi @chrisleekr

I am looking for the same issue that @uhliksk is looking for.
However, unfortunately I didn't get the time to see the main cause of that but yes, we have to find a solution first before releasing because the bot is continuously stopping at some point.

@uhliksk
Let me know if you need any help.