Algorithm to accurately finding swing & internal points

 

Hi,

I'm new to MQL5 and would like to make an indicator that identify the swing & internal points of the chart. I read that in order for you to find the swing/internal points then you need to identify the HH/HL/LL/LH of the chart. I want to collect some algorithm ideas on how to do this. Thanks!

 

Your topic has been moved to the section: Technical Indicators
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893

  • Usually people who can't code don't receive free help on this forum.
  • If you show your attempts and describe your problem clearly, you will most probably receive an answer from the community. Use the CODE button (Alt-S) when inserting code.
  • To learn MQL programming, you can research the many available Articles on the subject, or examples in the Codebase, as well as reference the online Book and Documentation
  • Remember also, that you can debug your code with MetaEditor's own debugging functionality.
  • If you do not want to learn to code, that is not a problem. You can either look at the Codebase if something free already exists, or in the Market for paid products (also sometimes free). However, recommendations or suggestions for Market products are not allowed on the forum, so you will have to do your own research.
  • Finally, you also have the option to hire a programmer in the Freelance section.
 
If you want purely accurate swing detection then you will achieve that with enormous delay, because true swings have to be confirmed and are after the fact.
If you want to find swings on time without delay it is just fleeting peak search and bottom search without caring about the true market structure, and there's a few trend based pivot indicators for that. Some are still after the fact, but others like psar are non lagging.
I published a psar zigzag, channel zigzag, and price percentage zigzag showing that there are completely different approaches that you can take. Study the code if you want to learn, or study other zigzags on the codebase as well
 
Conor Mcnamara #:
If you want purely accurate swing detection then you will achieve that with enormous delay, because true swings have to be confirmed and are after the fact.
If you want to find swings on time without delay it is just fleeting peak search and bottom search without caring about the true market structure, and there's a few trend based pivot indicators for that. Some are still after the fact, but others like psar are non lagging.
I published a psar zigzag, channel zigzag, and price percentage zigzag showing that there are completely different approaches that you can take. Study the code if you want to learn, or study other zigzags on the codebase as well


Is zigzag method the only accurate way to identify swing highs/lows at the moment?

 
Eka Rudianto #:


Is zigzag method the only accurate way to identify swing highs/lows at the moment?

I would say it is the best way, but I also made something called "magzag" which is a new approach to making the zigzag quantitative instead of being based on arbitrary price action.

There is also something called Fractals which really is nothing but a weaker version of the zigzag as it is based on turning points but has no input parameters. 

I attached a market structure indicator which is also essentially finding the swing highs and lows without using zigzag logic and doesn't repaint

Files:
 
Conor Mcnamara #:

I would say it is the best way, but I also made something called "magzag" which is a new approach to making the zigzag quantitative instead of being based on arbitrary price action.

There is also something called Fractals which really is nothing but a weaker version of the zigzag as it is based on turning points but has no input parameters. 

I attached a market structure indicator which is also essentially finding the swing highs and lows without using zigzag logic and doesn't repaint


Hi, thanks so much for the reply and the input! when you mentioned "doesn't repaint", what does that mean?

 
Eka Rudianto #when you mentioned "doesn't repaint", what does that mean?

"Repainting" means that the current bar calculations re-adjusts previous bars' indicator values. Most ZigZag indicators "repaint", some more than others.