chrisleekr / binance-trading-bot

Automated Binance trading bot - Trade multiple cryptocurrencies. Buy low/sell high with Grid Trading. Integrated with TradingView technical analysis
MIT License
5k stars 1.09k forks source link

Not enough precision when using BTC as base coin? #173

Closed starush closed 3 years ago

starush commented 3 years ago

When I use BTC as the base coin, at least two wrong things happen sometimes (not very often):

  1. The bot is unable to set the order due to small amount of coin it trying to sell.
  2. When it sells, leaves too much coins in the wallet

I guess this issue MAY BE be referred to BTC needs more precision in calculation then USDT does.

There are examples of selling value is smaller then buying value, and the rest left in the wallet (too much IMHO): image image image

There is an example when bot is unable to set the order (but profit/loss is more then enough) image

There are my settings: image All involved in this issue currencies was using the global settings.

chrisleekr commented 3 years ago

Hey @starush

I found that as well, but it was Binance doing it.

From Binance API, UNIBTC's step size is "0.1000000", which means you can only place an order quantity with "0.1" step.

{
    "filterType": "LOT_SIZE",
    "minQty": "0.10000000",
    "maxQty": "90000000.00000000",
    "stepSize": "0.10000000"
}

It's the same in the Binance app.

image

So even if you have 1.3, it only can sell 1.2 after calculating commission.

It's annoying I agree.

There is an example when bot is unable to set the order (but profit/loss is more then enough)

Oh, I think you found a bug. Let me fix it.

chrisleekr commented 3 years ago

@starush

I have fixed the bug that ALPHABTC was not placing the sell order. And added a bunch of tests for ALPHABTC.

Pull the latest code, build, and launch the bot again.

$ git checkout feature-monitoring-simultaneously
$ git pull
$ npm run docker:build
$ docker-compose -f docker-compose.server.yml up -d
$ docker ps -a
$ docker logs binance-bot -f --tail=1000 | bunyan

If the issue is resolved, please close the issue.

starush commented 3 years ago

Excuse me, I'm not too familiar with linux. Simple Git pull will not be enough?

On Fri, May 14, 2021 at 6:18 PM chrisleekr @.***> wrote:

@starush https://github.com/starush

I have fixed the bug that ALPHABTC was not placing the sell order. And added a bunch of tests for ALPHABTC.

Pull the latest code, build, and launch the bot again.

- https://github.com/chrisleekr/binance-trading-bot/blob/feature-monitoring-simultaneously/app/cronjob/trailingTrade/step/place-sell-order.js#L58

https://github.com/chrisleekr/binance-trading-bot/blob/feature-monitoring-simultaneously/app/cronjob/trailingTrade/step/__tests__/place-sell-order.test.js#L974

If the issue is resolved, please close the issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chrisleekr/binance-trading-bot/issues/173#issuecomment-841308872, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2H34VKB42WUDDPPVMDUUTTNU5LPANCNFSM442ACU7A .

-- Best regards, Serghei. mailto: @.***

chrisleekr commented 3 years ago

@starush Please read the PR thoroughly to make sure you know how to use it.

https://github.com/chrisleekr/binance-trading-bot/pull/77#issue-608384137

And I put the commands for you in the above comment.

chrisleekr commented 3 years ago

@starush If the issue is resolved, please close the issue.

starush commented 3 years ago

Sorry for delay, bro. It seems to be working now.

On Sun, 16 May 2021 at 09:47, chrisleekr @.***> wrote:

Closed #173 https://github.com/chrisleekr/binance-trading-bot/issues/173 .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chrisleekr/binance-trading-bot/issues/173#event-4750732814, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2H34T2WMRVXH654DJPJ23TN5S6NANCNFSM442ACU7A .

-- Best regards, Serghei. mailto: @.***

starush commented 3 years ago

Hi! Yet another case with "unable to make order" [image: image.png]

Meanwhile, I was able to make an order from windows app: [image: image.png]

On Sun, May 16, 2021 at 9:50 AM Serghei Starus @.***> wrote:

Sorry for delay, bro. It seems to be working now.

On Sun, 16 May 2021 at 09:47, chrisleekr @.***> wrote:

Closed #173 https://github.com/chrisleekr/binance-trading-bot/issues/173.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chrisleekr/binance-trading-bot/issues/173#event-4750732814, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG2H34T2WMRVXH654DJPJ23TN5S6NANCNFSM442ACU7A .

-- Best regards, Serghei. mailto: @.***

-- Best regards, Serghei. mailto: @.***