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
5.05k stars 1.1k forks source link

Different between current and highest price. #67

Open BramFr opened 3 years ago

BramFr commented 3 years ago

Is your proposal related to a problem?

Not a problem like software issue more frustration.

Describe the solution you'd like

  1. When a Coin drops within a few minutes with 15% (current price vs highest price and between the candles interval) but still higher then the buy/lowest counter it can be interesting to buy

  2. When the current price >15% vs highest price buy coins.

  3. When the current price <15% vs highest price do nothing

  4. When the Trigger Sell price < Highest price dont buy

Describe alternatives you've considered

Doing manual.

chrisleekr commented 3 years ago

Hey @BramFr, this is interesting strategy.

  1. When a Coin drops within a few minutes with 15% (current price vs highest price and between the candles interval) but still higher then the buy/lowest counter it can be interesting to buy

So when there is a sharp drop, you would like to place a trailing buy order, right?

  1. When the current price >15% vs highest price buy coins.

Confusing. So place a trailing buy order when the current price is higher than 15% down of the highest price?

  1. When the current price <15% vs highest price do nothing

Confusing again. If the current price dropped more than 15% of the highest price, don't buy?

  1. When the Trigger Sell price < Highest price dont buy

What do you mean by this step?

I think I kind of understand what you are trying to do, but would be able to give a detailed scenario using the price numbers? So I understand 100% of your strategy?

BramFr commented 3 years ago

Hey @BramFr, this is interesting strategy.

  1. When a Coin drops within a few minutes with 15% (current price vs highest price and between the candles interval) but still higher then the buy/lowest counter it can be interesting to buy

So when there is a sharp drop, you would like to place a trailing buy order, right?

Indeed. When a sharp drop > 15 % its interesting to buy. Even when the current price still higher than the lower/trigger price. Example Highest price: 100 Dropping to: 85 >= 15% this will hit a buy order trigger price: 80

Its possible that this never hit the trigger price. You can consider a option that the drop of 15% must be within a timestamp of 1hour?

  1. When the current price >15% vs highest price buy coins.
  2. When the current price <15% vs highest price do nothing Indeed very confusing sorry for my bad English.

Almost the same as the example above but then without the drop (drop timestamp) and looking for longer information. Highest price: 120 current value to: 100 (20% different then highest price with a 15% sell profit value) buy coins. trigger price: 80

When you have a sell value of 15% and the difference between the highest value and current value > 20% (because you want to have a marge between these values). It can be interesting buy.

  1. When the Trigger Sell price < Highest price dont buy

What do you mean by this step?

example: When you have a flat line with a 1h candle with 100 interval and this will hit the trigger price. Its not interesting to buy any coins when the highest value within 4h candle with 200 interval isn't higer x% then the current value.

1h candle with 100 interval Trigger price 100

4h candle with 200 interval highest price 105

This will indicate a profit of 5% but when you have a sell value of 15%. Its possible that this coin will never hit this 15% of profit or you have to wait a very long time to hit this value. There must be a option to disable / enable this feature.

I think I kind of understand what you are trying to do, but would be able to give a detailed scenario using the price numbers? So I understand 100% of your strategy?

I`ll hope i make this clear :)

chrisleekr commented 3 years ago

Hi @BramFr

I was considering your strategy, however, I don't think I will add that strategy to buy signal.

I mean, if you want to target sharp drop, you may change the candle number to a small number of candles. Then, the lowest price will be close to the current price. If there is a sharp drop that reaches the lowest price, the bot will follow the drop and buy at the lowest price.

And we have Buy Trigger Percentage that you can set to give some buffer for buying. (Thanks to @Maxoos suggestion #18).

Hm, others may think differently.

Let me keep this issue open to see how others think.

4KJuegos commented 3 years ago

May be interesting, because the trigger with minimum sometimes doesn't work. An option to try the trigger minimum or the drop percentage may be interesting. Cryptos works different one of the other. The funcionality is the same as the sell, when drops below the percentage, it will start to set the stop-loss to buy. Can you add also a STOP-LOSS? It's impossible to add it directly because the bot remove it from binance. And you can also add an option to link this stop-loss to the last buy price. With this, if the price falls, the stop-loss will sell and with trigger percentage that BramFr says, you go to buy on best price ever.

The idea is that if price fall below your buy, you can stop losing and then, buy again to a better price.

BramFr commented 3 years ago

I mean, if you want to target sharp drop, you may change the candle number to a small number of candles. Then, the lowest price will be close to the current price. If there is a sharp drop that reaches the lowest price, the bot will follow the drop and buy at the lowest price.

The problem with this is you have to adjust the candle number al the time... When you dont have any dorp you would have a candle 1h with 100 interval. To play save

When there is a drop you want something like 30m with 30 interval. Highst value = 1 current drop value = 0.8 (this is a drop of 20%. When your "sell trigger percent" has a value of: 1.10 its interesting to buy) trigger value = 0.5

Highst value = 1 current drop value = 0.8 (this is a drop of 20%. When your "sell trigger percent" has a value of: 1.30 its not interesting to buy because the coin have may not reach the "sell trigger percent" value.) trigger value = 0.5

chrisleekr commented 3 years ago

@4KJuegos

May be interesting

I do agree this is a very interesting strategy.

With this, if the price falls, the stop-loss will sell and with trigger percentage that BramFr says, you go to buy on best price ever.

However, I don't think this is a good strategy. Let me try to give an example.

Let say, current market & configuration are like below:

In the next 30 mins, if the price drops to $102 and I place a BUY order for the coin and immediately place STOP-LOSS order as you mentioned

In the next few minutes, if the price drops to $96.9, then the STOP-LOSS order will be executed, but the current price is still in the range of Drop buy percentage (less than $102). The bot will think it's in range, so buy again. And if drops another 5% (Stop Loss percentage), then it will sell again. So you keep losing the money.

I may be able to overcome this issue by checking not to place multiple BUY order within Drop buy trigger price.

But the actual problem goes below the situation: (Mind for copy and paste above example, I highlighted the difference.)

Let say, current market & configuration are like below:

In the next 30 mins, if the price drops to $102 and I place a BUY order for the coin and immediately place STOP-LOSS order as you mentioned

In the next few minutes, if the price drops to $96.9, then the STOP-LOSS order will be executed. But the current market is like this:

Then the bot will purchase the coin again because it is reached the lowest price.

So you will have to choose either using sharp drop strategy or the lowest price buy strategy.

Hm, I wrote too long, hope what I said is making sense.

chrisleekr commented 3 years ago

@BramFr

Highst value = 1 current drop value = 0.8 (this is a drop of 20%. When your "sell trigger percent" has a value of: 1.10 its interesting to buy) trigger value = 0.5

Highst value = 1 current drop value = 0.8 (this is a drop of 20%. When your "sell trigger percent" has a value of: 1.30 its not interesting to buy because the coin have may not reach the "sell trigger percent" value.) trigger value = 0.5

I assume you meant "Buy trigger percentage".

I think the above reply would have answered the issue with the sharp drop buy.

4KJuegos commented 3 years ago

@4KJuegos

May be interesting

I do agree this is a very interesting strategy.

With this, if the price falls, the stop-loss will sell and with trigger percentage that BramFr says, you go to buy on best price ever.

However, I don't think this is a good strategy. Let me try to give an example.

Let say, current market & configuration are like below:

  • Highest & current price: $120
  • Lowest price within 1h period: $80
  • Drop buy percentage: 15%
  • Drop buy trigger price: $102
  • Stop Loss percentage: 0.95 (5%)

In the next 30 mins, if the price drops to $102 and I place a BUY order for the coin and immediately place STOP-LOSS order as you mentioned

  • Current price: $102
  • Stop Loss order: $96.9

In the next few minutes, if the price drops to $96.9, then the STOP-LOSS order will be executed, but the current price is still in the range of Drop buy percentage (less than $102). The bot will think it's in range, so buy again. And if drops another 5% (Stop Loss percentage), then it will sell again. So you keep losing the money.

I may be able to overcome this issue by checking not to place multiple BUY order within Drop buy trigger price.

But the actual problem goes below the situation: (Mind for copy and paste above example, I highlighted the difference.)

Let say, current market & configuration are like below:

  • Highest & current price: $120 - Lowest price within 1h period: $100
  • Drop buy percentage: 15%
  • Drop buy trigger price: $102
  • Stop Loss percentage: 0.95 (5%)

In the next 30 mins, if the price drops to $102 and I place a BUY order for the coin and immediately place STOP-LOSS order as you mentioned

  • Current price: $102
  • Stop Loss order: $96.9

In the next few minutes, if the price drops to $96.9, then the STOP-LOSS order will be executed. But the current market is like this:

  • Current price: $96.9
  • Lowest price: $96.9

Then the bot will purchase the coin again because it is reached the lowest price.

So you will have to choose either using sharp drop strategy or the lowest price buy strategy.

Hm, I wrote too long, hope what I said is making sense.

Yeah, you are right! Sorry, I forgot to thank you for your work! This bot is the best I tried!

BramFr commented 3 years ago

@BramFr

Highst value = 1 current drop value = 0.8 (this is a drop of 20%. When your "sell trigger percent" has a value of: 1.10 its interesting to buy) trigger value = 0.5 Highst value = 1 current drop value = 0.8 (this is a drop of 20%. When your "sell trigger percent" has a value of: 1.30 its not interesting to buy because the coin have may not reach the "sell trigger percent" value.) trigger value = 0.5

I assume you meant "Buy trigger percentage".

I think the above reply would have answered the issue with the sharp drop buy.

sorry for my bad english :).

Nope i do mean "sell trigger percent" Example: 2021-04-07_16-10

At this example this coin will never hit his Lowest Value because this coin has a nice increase value. Highest value: 23.430 current Value: 19.920 LowestValue: 16.550 Buy Trigger price (0.00%): 16.550 Sell Trigger price (10.00%): ???

At this point the difference between current and Highest value +/- 17% because 17 is much higher then my Sell Trigger price (10.00%) it can be intresting to buy.

You can make a fail safe option like: % difference between H/C = 1.15 (15%) Candle counts = 5 1h

summary: Within the first 5 candle the price drop from: 23.430 - 15% "% difference between H/C" = 19.9155

Highest value: 23.430 current Value: 19.9155 "% difference between H/C": 1.15 (this value is most likely higher then "Sell Trigger price") AND Candle counts = 5 1h Lowest Value: 16.550 Buy Trigger price (0.00%): 16.550 Sell Trigger price (10.00%): ???

Make a buy order

chrisleekr commented 3 years ago

Ah, I see what you mean now. So you mean we can use Sell trigger percentage for buying.

Let me re-summarise what I understood from your summary to make sure I understood correctly:

If the current price drops within 5 candles to less than Sell trigger price (10%): 21.087 of the highest price, then place a buy STOP-LOSS-LIMIT order. So above case will place a buy STOP-LOSS-LIMIT order.

Am I understanding correctly?

BramFr commented 3 years ago

Ah, I see what you mean now. So you mean we can use Sell trigger percentage for buying.

Let me re-summarise what I understood from your summary to make sure I understood correctly:

  • Highest price within candles: 23.430
  • Current price: 19.9155 (15% less than the highest price)
  • Lowest price: 16.550
  • Sell trigger price of the highest price(10%): 21.087
  • Number of monitoring candles for the sudden drop: 5 candles

If the current price drops within 5 candles to less than Sell trigger price (10%): 21.087 of the highest price, then place a buy STOP-LOSS-LIMIT order. So above case will place a buy STOP-LOSS-LIMIT order.

Am I understanding correctly?

Indeed. 👍 This will work.

ill consider extra option to make sure you will hit the Sell trigger price just for certainty

The difference between current en High must be >15% to make sure you will hit the 10% sell trigger price.

But your example will do the job also.

ggloveswp commented 3 years ago

@BramFr out of curiosity, what amount of candles/interval have you currently set the bot at?

Asking just because Im trying to follow the same trading logic, partially: looking to place buy orders in sudden -5% (within last X(1-9) hours) drops and selling back at +5% with no specific timeframe, no matter if I hodl those coins forever.

Im currently confused about the candles amount and interval needed for my scope.

BramFr commented 3 years ago

@BramFr out of curiosity, what amount of candles/interval have you currently set the bot at?

Asking just because Im trying to follow the same trading logic, partially: looking to place buy orders in sudden -5% (within last X(1-9) hours) drops and selling back at +5% with no specific timeframe, no matter if I hodl those coins forever.

Im currently confused about the candles amount and interval needed for my scope.

I don't recommend any settings its still at your own risk.. When coin has a stable or i dont have any time ill used something like 2h with 80 interval with buy percent 1. Just to play safe

But when i know there is a sharp dorp for some coins ill change it to 30m with 30interval with buy percent 1 ore something but you have to look at everycoin if this settings possible.

im still experimenting with this :)

chrisleekr commented 3 years ago

@BramFr

  • % difference between H/C = 1.15 (15%)
  • Sell trigger price of the highest price(10%)

When you say H/C, it stands for Highest Candle? or Highest Price?

Either way, this strategy could be implemented. Although I will need reasonable option names to make understanding easier. And detailed example strategy.

Just note I am still testing #77 which was massive refactoring. I won't add more features until that is stable. So this change may be delayed.

BramFr commented 3 years ago

@BramFr

  • % difference between H/C = 1.15 (15%)
  • Sell trigger price of the highest price(10%)

When you say H/C, it stands for Highest Candle? or Highest Price?

% difference between H/C = 1.15 (15%) H = Highest Price C = Current Price