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

Dip Detection Strategy #219

Open salimj6 opened 3 years ago

salimj6 commented 3 years ago

Hello Chris,

I noticed something while trading. It is almost always a good buy when in a dip. We can detect this dip by adding the volume trading over a period of say 2 or 3 minutes and setting a value threshold that would trigger the buy.

For example, check the attached image. All crypto prices have the same trend. It is a way of detecting a dip.

image image

We can add an option, buy dip and set a volume threshold over a few mins (can be variable as well). So the user can select whether to buy with the regular strategy or with the dip detection strategy. Selling is beautiful, i don't think we need to touch that yet.

I can try to help with this implementation, but i honestly have a lot on plate now. If you direct me to the areas in code where this can be added i will definitely fiddle with it on every free time i have.

chrisleekr commented 3 years ago

Hi @salimj6 Thank you for the good suggestion.

I think what you are asking is very similar to https://github.com/chrisleekr/binance-trading-bot/issues/67

If it is the same strategy, to implement this, I have summarised how to implement it: https://github.com/chrisleekr/binance-trading-bot/issues/67#issuecomment-816375999

To do this, you will need to touch the determine action step.

If it is the same strategy, let's close this issue and continue the discussion in #67. If not, please let me know.

salimj6 commented 3 years ago

@chrisleekr I read the thread of #67 , the suggestion there relies mainly on the prices. What i am suggesting is relying on the volume trading of the market at a given time span. Now that I am thinking of it, we can confirm that this is a dip in price if the following condition applies, i will set an example:

  1. Current price is 100$

  2. average trading volume is sellVolume - buyVolume =+/- 500K over the last 5 minutes (price will be hovering between 98$ and 102$)

  3. suddenly we have over 2 minutes a (sellVolume - buyVolume = 5M) - which drives the price to 92$ or 80$ or 96$.... doesn't matter, we are monitoring volume

  4. Here we trigger the buy strategy that you have already mastered, which will keep on following the dip until our defined percentages are met.

So basically, this trigger will start buying regardless of the current/lowest/highest prices, it is simply making an educated buy based on volume of trading over the past couple of minutes.

chrisleekr commented 3 years ago

@salimj6

I think getting volume won't be an issue as it already does.

We will be able to store the candles for the last 5 mins and determine actions in the below code:

The question is how will we make variables and how to calculate the decision to buy.