Mastering the ZigZag Semaphore Indicator for MetaTrader 4

Mike 2019.12.23 00:37 35 0 0
Attachments

Hey fellow traders! Today, let's dive into the ZigZag Semaphore indicator, which is a handy tool for your MetaTrader 4 setup.

This indicator works by placing a mark (or semaphore) at each zigzag point for four different evaluation lengths. Instead of drawing lines on your charts, it simply marks the locations of those zigzags, making it easy to spot key turning points in the market.

The algorithm behind this is one of the simpler zigzag methods found in the "!!!-MT4 SEMAFOR" posting. It's implemented through functions like DetectNewSwing, LoadIndiBuffers, and SetSwingBarValues. The original version had issues running in the strategy tester, but don't worry—this version works just fine!

The marks created by the indicator indicate levels with a neat color-coding system:

  • Level 1: A small white dot
  • Level 2: A red circle around the white dot
  • Level 3: A yellow circle around both the white and red circles
  • Level 4: A green circle surrounding all three


As for the lengths, you can easily customize them according to your trading style. Here are the default values:

  • Level 1 Length: 21
  • Level 2 Length: 40
  • Level 3 Length: 60
  • Level 4 Length: 72

Two additional controls have been added for your convenience. One allows you to toggle text labels that show the marked zigzag's price value on and off, while the other lets you remove all indicator marks from the display with just a click. This way, you can keep your chart clean and clutter-free!


I’ve made sure to structure and comment the code well, so if you're interested in the nitty-gritty details, it should be easy to follow.

Happy trading, and may your zigzags be ever in your favor!

List
Comments 0