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

does not save the last purchase price trade bot #116

Closed niyazikeklik closed 3 years ago

niyazikeklik commented 3 years ago

Hello, I don't quite understand why. I was not in front of the computer, so I don't know what happened at that time, but the last purchase price was not recorded for the two orders below. I manually recorded it myself when I woke up in the morning. This is a very risky bug.

image

chrisleekr commented 3 years ago

Hey @niyazikeklik

Are you using master version or #77 branch?

niyazikeklik commented 3 years ago

I am less experienced in these matters.

I installed it with this command. git clone https://github.com/chrisleekr/binance-trading-bot.git

How can I update if there is a new version available?

chrisleekr commented 3 years ago

Hmm, so I assume you are using master version, which is stable.

Can you take a screenshot of the chart when the bot purchased price?

niyazikeklik commented 3 years ago

image

I'm not sure what I'm using. I am learning many things through your application.

-Virtual machine -Linux -Docker -Git

So I run a lot of commands to try it out. Sometimes things can get messy. I don't know what I'm doing myself either. :) I'm sorry.

chrisleekr commented 3 years ago

Hey @niyazikeklik

I will need more information to find out what happened.

The chart you attached is for RVNUSDT? Why there is selling text in the chart? Was it sold?

niyazikeklik commented 3 years ago

No, it bought it last night, and when I woke up this morning, the purchase price didn't seem to be recorded. I saved it manually and then RVNUSDT was instantly dropped and sold.

chrisleekr commented 3 years ago

Was the price dropped after bought?

image

It looks like you only bought 14USDT, which is a small amount. After purchasing it and the price went down, then the coin could be worth less than 10 USDT. Then the bot would remove the last buy price because it would not be able to place an order.

niyazikeklik commented 3 years ago

No, I thought about that. The minimum price after purchase is 0.12095 i.e. 116 RVN = 14 USDT.

chrisleekr commented 3 years ago

Right, that is very strange. Never had that issue with master branch.

The code to save the last buy price is this - https://github.com/chrisleekr/binance-trading-bot/blob/master/app/jobs/trailingTrade/step/place-buy-order.js#L121

As you can see, after placing the buy order, it saves into the mongodb, which is a persistent database. It would not lose the price unless matching the condition in this file - https://github.com/chrisleekr/binance-trading-bot/blob/master/app/jobs/trailingTrade/step/remove-last-buy-price.js#L49

As I don't have any access on your bot or Binance, I won't be able to debug what actually happened.

If you are ok to use an unstable version, try to use this PR #77. This PR has a code that sends a notification when the last buy price is removed from the bot.

image

Of course, you should use Slack to receive the notification.

niyazikeklik commented 3 years ago

Right, that is very strange. Never had that issue with master branch.

The code to save the last buy price is this - https://github.com/chrisleekr/binance-trading-bot/blob/master/app/jobs/trailingTrade/step/place-buy-order.js#L121

As you can see, after placing the buy order, it saves into the mongodb, which is a persistent database. It would not lose the price unless matching the condition in this file - https://github.com/chrisleekr/binance-trading-bot/blob/master/app/jobs/trailingTrade/step/remove-last-buy-price.js#L49

As I don't have any access on your bot or Binance, I won't be able to debug what actually happened.

If you are ok to use an unstable version, try to use this PR #77. This PR has a code that sends a notification when the last buy price is removed from the bot.

image

Of course, you should use Slack to receive the notification.

How can I tell which version I am using?

chrisleekr commented 3 years ago

Hmm... I know you mentioned you are not familiar with this kind of thing. I won't have time to teach you every single command to use.

Please do your own research. Thanks.

chrisleekr commented 3 years ago

Please close the issue if the issue is resolved.