Discussion of article "How to detect trends and chart patterns using MQL5"

 

New article How to detect trends and chart patterns using MQL5 has been published:

In this article, we will provide a method to detect price actions patterns automatically by MQL5, like trends (Uptrend, Downtrend, Sideways), Chart patterns (Double Tops, Double Bottoms).

Uptrend:

This type of price movement results that prices continuing to move upward achieving higher prices as buyers are the strong party according to this type in the market. So, we can find on the chart that the price forms higher lows and higher high clearly. The following figure is a graph for this type:

upTrend

Downtrend:

This type of trend is the opposite scenario of the uptrend type as in this downtrend type sellers are stronger than buyers and pushes prices down achieving lower price. So, we can see on the chart that prices form lower highs and lower lows.

The following is a graph to describe it from a visual perspective:

downTrend

Author: Mohamed Abdelmaaboud

 
thank you for this code, exactly the straightforward approach I needed
 
Very good read and very helpful. Thanks for sharing. 
 
Plamen Zhivkov Kozhuharov #:
thank you for this code, exactly the straightforward approach I needed

Thanks for your kind comment, I hope it will help your progress.

 
Richie C #:
Very good read and very helpful. Thanks for sharing. 
Thanks for your kind comment.
 
Thank you for this article. Very very helpful.
 

Hi and thanks for providing this information!

Can you kindly advise why you multiply the count variable by 2 (count*2)?

Thanks.

 
Josh #:
Thank you for this article. Very very helpful.

Thanks for your kind comment.

 
Geester #:

Hi and thanks for providing this information!

Can you kindly advise why you multiply the count variable by 2 (count*2)?

Thanks.

Thanks for your comment.

We multiplied the count by 2 as we need to look one time to left and one time to right to compare moves from the current bar then add 1 to the result of multiplication to include the current bar which I start from.

 
Mohamed Abdelmaaboud #:

Thanks for your comment.

We multiplied the count by 2 as we need to look one time to left and one time to right to compare moves from the current bar then add 1 to the result of multiplication to include the current bar which I start from.

Thank you very much for explaining. I appreciate it! 

 

Un grand merci pour cet article, car c'est vraiment déjà un bon début pour moi. D'autant plus que je ne peux pas m'arrêter à longueur de journée à parcourir les articles postés ici sur ce magnifique site à la recherche de ceux qui pourraient justement utiliser cette possibilité de faire la détection automatique de ce genre de chiffres, qui, d'après le propre homme peu expérimenté dans cette entreprise, sont d'une importance significative dans l'analyse technique.

Seulement, par rapport à votre code, en ce qui concerne la détection des configurations en M (double top) et celles en W ( double bottom ), n'y at-il aucune possibilité de proposer un code qui soit capable de tracer plutôt 4 lignes différentes et définitives (dessin plus ou moins clairement sur le graphique an M) ? Plutôt que des lignes qui se redessinent à mesure que les prix changent, ce qui n'est pas du tout une bonne chose a choisi lorsqu'il s'agit de repérer des modèles.  

Quant au double top, par exemple :

1.   Une première ligne, qui dessinera la première jambe haussière. Et la ligne reste définitive sans plus avancer avec les prochains changements de cap...

2. Une seconde, qui tracera la première correction baissière, indiquera dans le même temps une formation potentielle d'un premier sommet d'une figure M potentielle.

3. Un troisième, qui retrace la reprise haussière (une seconde impulsion haussière), et alerte le trader sur l'imminence d'un retour…

4. Et, enfin, une ligne arrière qui sera tracée une fois la figure réellement formée...

Eh bien, je pense que vous avez compris mon inquiétude.

Est-ce un code capable de faire ces différents tracés n'est-ce pas possible ? MERCI

Reason: