chrisleekr/binance-trading-bot

Only trade within margin from highest price

Maxoos opened this issue · 9 comments

Is your proposal related to a problem?

When a coin trades around ATH, or recent Max value, I don't want the bot do make any buy orders. I would still like to keep the Candle limit a certain amount to monitor recent trend, however, if the coin is trading very high I would like to prevent buy orders.

Describe the solution you'd like

I suggest a percentage margin from max value in recent history (separately from the candle limit), or at least ATH, where the bot will disable buy orders.

For example, ETHUP max value in the last 30 days was 165. I would like to keep the candle limit low (say, 30min/40) but avoid buy orders if current price is within a 10% margin of 165. This will reduce risk as sometimes the bot will buy high and it will take a few weeks to get to the same point and sell in profit.

The only other way to avoid this would be increasing the candle limit which will work well, however, would require changing to a lower limit once the price has dropped.

It's a very good strategy, I typically manually adjust coins. But if you have many coins to monitor, then it would be painful to change every coin.

So key points are:

  • Have separate candles to determine ATH
  • Determine the ATH(All time high) price
  • Configure Buying restriction percentage like 10%
  • Calculate Buying restriction price from the highest price.

So the UI will display for the buy signal like:

  • ATH price: 165.000
  • Buying restriction price: 148.5
  • Current price: 149.000
  • Lowest price: 149.000
  • The current price has reached the lowest price; however, it is restricted to buy the coin.

The only issue with this is, it will require extra API calls. Not sure it causes over API limit, need testing.

Did I miss anything?

Yeah that's correct. Although I would only take the max price for say the last 30 days, not ATH. Also you can just make an hourly or daly call and save the max amount to the database somewhere. Even if max prices incenses and decreases rapidly within a day there's no harm done, it would simply not buy.

I have added this feature to TODO list. I think this will be very useful to not purchase the coin when the coin is falling from ATH.

It's a very good strategy, I typically manually adjust coins. But if you have many coins to monitor, then it would be painful to change every coin.

So key points are:

  • Have separate candles to determine ATH
  • Determine the ATH(All time high) price
  • Configure Buying restriction percentage like 10%
  • Calculate Buying restriction price from the highest price.

So the UI will display for the buy signal like:

  • ATH price: 165.000

  • Buying restriction price: 148.5

  • Current price: 149.000

  • Lowest price: 149.000

  • The current price has reached the lowest price; however, it is restricted to buy the coin.

The only issue with this is, it will require extra API calls. Not sure it causes over API limit, need testing.

Did I miss anything?

Good strategy!!!. Thank a lot for your contribution

It's a very good strategy, I typically manually adjust coins. But if you have many coins to monitor, then it would be painful to change every coin.

So key points are:

  • Have separate candles to determine ATH
  • Determine the ATH(All time high) price
  • Configure Buying restriction percentage like 10%
  • Calculate Buying restriction price from the highest price.

So the UI will display for the buy signal like:

  • ATH price: 165.000

  • Buying restriction price: 148.5

  • Current price: 149.000

  • Lowest price: 149.000

  • The current price has reached the lowest price; however, it is restricted to buy the coin.

The only issue with this is, it will require extra API calls. Not sure it causes over API limit, need testing.

Did I miss anything?

First of all, thanks @Maxoos for your idea!
@chrisleekr I like your explanation as it makes things easy to implement

I implemented this strategy and it looks like running smoothly without API limitations. The used weight in 1m is 180 on average.
I am happy with the result and I got a commission of around $8 after applying this strategy within these two days.

(Don't be afraid about the first three coins shown below because it was bought suddenly and I lose them when I am testing the bot and before implementing this strategy xD)

You can look for the settings and how is the UI looks like. Any improvements will be welcomed. I am thinking to make a checkbox somewhere to enable or disable ATH.

image

Global Settings (There are custom settings for each coin as well!)
image

image

If you would like me to make a pull request, I can do that.

@habibalkhabbaz

Wow, you have implemented exactly what I described.

Yes, please. Let me take a look and merge in. Please open PR :)

@chrisleekr Sure will do it now.

Hey @habibalkhabbaz

The change looks pretty good.
Do you mind I change some code before merging in?

I want to add to your repo.

  • Enable/disable ATH restriction
  • Test code

@chrisleekr Sure, go ahead and I will be more than happy :)
Let me know if you want me to do something from my side.