Sponsors
Major Sponsor: Alpari
Golden Sponsor: United World Capital
Silver Sponsor: RoboForex
Organizer
Organizer: MetaQuotes Software Corp.
MQL5.community

Applying ZigZag for Analysis

[ru]

Each newcomer wants to create a trading system capable of making maximum profit on each price movement. As time passes by, traders gain more and more experience finally reaching more realistic expectations and abandoning their dreams to buy exactly on the very bottoms and sell on the very tops. Everyone knows that it is impossible to trade with the accuracy of ZigZag indicator often shown on history data. But it is possible enough to use ZigZag to calculate the virtual maximum profit...


Zigzags Are Different

All traders know about this indicator and it is impossible to find even a single trader who has not used it at least once. Some traders liken ZigZag to Elliott waves, some use it to obtain objective data on the current market state. Each developer of automated trading systems has his or her own idea about ZigZag.

The terminal's standard delivery contains two types of this indicator - standard one for several generations of MetaTrader terminals ZigZag and its color version ZigZagColor . Over the years, many attempts have been made to improve this indicator. Perhaps, no one knows the exact number of versions, except for Eugeni Neumoin, developer of ZUP complex.

We have decided to use ZigZag from the standard delivery as a tool for a simple analysis of the Automated Trading Championship currency pairs. So, today we will finally answer the question that we could not answer earlier due to lack of time or skills: "How much can you earn with ZigZag (in theory, of course)?"

Virtual deals on EURUSD based on ZigZag indicator


What and How Have We Measured?

The Championship audience, as well as everyone interested in algo trading, was always curious about how many Championship participants trade some definite symbol or timeframe. Therefore, we have examined all 12 currency pairs that were available at the Automated Trading Championship 2011 and used ZigZag to calculate the following parameters:

  • number of ZigZag bends,
  • maximum possible profit when trading 1 lot,
  • average bend length.

Calculations have been made on the period from October 1, 2011 to December 25, 2011, which roughly covers the last year's Championship. Calculations have been made for twelve currency pairs on 8 timeframes from M1 to H4 inclusively. Larger timeframes have not been considered, as they were not so popular among the participants of the Automated Trading Championship 2011. We also wanted to know if there any correlation between selection of a currency pair and its characteristics in this review.

Simply said, we tried to determine if the competition participants turned out to be right when choosing their timeframes and currency pairs.


Number of ZigZag Bends at Different Timeframes

It is quite obvious that the smaller timeframe we use, the more bends the ZigZag line will have. When increasing the period from M1 to H4, the number of ZigZag bends will decrease. Can it be some sort of regularity? Let's see that on EURUSD, on the period from October 1, 2011 to December 25, 2011.

Correlation of ZigZag bends with timeframe on EURUSD


As expected, most segments have been observed on M1, 5246 sections formed the ZigZag curve on almost 3 months of ATC 2011. H4 period showed the least amount of ZigZag segments. The correlation between the number of bends and selected timeframe is not clearly seen in this form. Therefore, we have used the logarithmic scale for the horizontal axis. Here are the results:

Logarithmic graph displaying the correlation between the number of bends and the timeframe

Now, we can clearly see the linear dependence as timeframe is increasing. Thus, we can conclude that ZigZag indicator irregularity changes exponentially with the change of a timeframe. That is,

N= a+exp(Timeframe-b)

where:

  • N - number of the indicator bends,
  • Timeframe - number of seconds in a timeframe,
  • a и b - some ratios.

But may this regularity work only at EURUSD? Let's gather all 12 currency pairs together.

Number of ZigZag bends on all 12 pairs

This regularity seems to work for other currency pairs as well.


Maximum Theoretical Profit in Terms of ZigZag

Now, it is time to analyze the most controversial part of ZigZag application. Let's calculate how much profit we would have made if we had performed deals exactly at its tops and bottoms. This is a theoretical issue but it also reflects the nature of the currency pair and allows us to compare different symbols.

Suppose that we have opened position by 1 lot at this currency pair on October 1, 2011 and closed it on December 26 at 00:00 AM. Since ZigZag alternates ups and downs, we are constantly in the market reversing our position at each extremum point. Spread is taken into account, as it is important for M1 timeframe, though it is barely noticeable on H4.

Here are the results:

Maximum theoretical profit when trading 1 lot

In this case, we do not need the logarithmic scale to display the theoretical profit. We can see the linear correlation between the profit and selected timeframe. It means that the profit decreases when passing from smaller to larger timeframes: M1 -> M5 -> M10 -> M15 -> M30 -> H1 -> H2 -> H4. But it does not mean that trading on M1 is the most profitable. At least, that is not true for all participants of the Automated Trading Championship 2011.

According to our survey called Preferences of the ATC 2010 Participants, H1, M1, M15 and M5 are the most popular timeframes in descending order. Let's examine their theoretical profit for all 12 pairs.

Theoretical profit correlation for 4 timeframes

The most popular H1 period has 4 similar-looking currency pairs: EURUSD, GBPUSD, GBPJPY and EURJPY. The same currency pairs turned out to be the best ones on the rest three timeframes.


ZigZag Bend's Average Length

The last parameter we have calculated is the average length of ZigZag bend for each of the eight timeframes. It is certainly closely correlated with the previous two parameters but we decided to show it to close the issue completely.

Average length of ZigZag bend

Here we used the logarithmic scale for the horizontal axis displaying the average bend's length in pips (points) for each symbol. Once again we can see the linear dependence when transforming the length in such a way. This means that the average length of ZigZag segment grows logarithmically when increasing timeframe value.

However, we can see two strong exceptions from that rule for EURCHF and USDJPY. The length of an average section on H4 has suddenly turned out to be less than the one on H2. We do not know the reasons for that.


Conclusions Are Yours to Make

As expected, ZigZag indicator has confirmed our expectations - trading on smaller timeframes is potentially more profitable than on large ones. In real trading, we should consider that the market noise level on M1 is considerably higher than on H1 or D1. 

Participants of the Automated Trading Championship 2012 have to solve a difficult task. They should ensure that their trading strategy shows the maximum profit and at the same time is quite resistant to false trading signals and possible market changes that will surely happen during 3 competition months.

ZigZag is a good indicator, though most often it is good for history analysis. However, it is said that its bends can be used by experienced traders for developing not only great graphical tools but also trading systems. We have only tried to apply it in measuring currency pairs. Conclusions are yours to make.

We also remind you that only 10 days have left before the registration end. During this time you should fill your personal data, submit your trading robot and pass the automatic tests if you have not done that yet!

Published by: MetaQuotes Created: 11 September 2012  Print version
Leaders of the Automated Trading Championship 2010 and 2011: Pole-PositionLeaders of the Automated Trading Championship 2010 and 2011: Pole-Position

Are you still full of doubts that testing a strategy on historical data can be useful in real trading? In this article, we will compare achievements of the previous Championships' leading participants with their results shown in MetaTrader 5 Strategy Tester during the automatic tests.

Last Days before the Registration End

Last Days before the Registration End

Registration for the Automated Trading Championship has entered its final stage. Less than three days have left before the deadline. More than 3 400 applications have already been submitted. However, it depends only on the applicants themselves if they are able to become actual participants. In recent days, the number of potential competitors for the prize money is increasing but most of them will not be accepted for the competition.

 Previous Next 
Just tried it. Seems like latest bend can disappear if trend goes wrong way. ZigZag is really beautiful to determine market volatility.
2012.09.13 19:03 CeleronS281