Download MetaTrader 5

Examples: How to Write Fast Non-Redrawing ZigZags

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
185974
MetaQuotes Software Corp.  

New article How to Write Fast Non-Redrawing ZigZags has been published:

A rather universal approach to writing indicators of the ZigZag type is proposed. The method includes a significant part of ZigZags already described and allows you to create new ones relatively easily.

First of all, let's try to formulate the general approach to writing an indicator. Thus:

- Function start() of any indicator (as well as any EA) represents a callback function, i.e., a function to be called to process a specific event. Namely, to process a tick.

- The object of writing an indicator is, as a rule, the calculation of one or several market characteristics. Along with the ancillary quantities necessary for calculations, they form a set of key variables of the given indicator. Let's defined the state of the indicator as a set of the values of those key variables at a specific time. Basing on this definition, we can state the following:

  • Calculating the new values of variables at a new tick, function start() calculates the new state of the indicator.
  • Thus, in fact, function start() is an operator that transfers the indicator from one state into another.

- In these terms, the process of writing an indicator reduces itself to determining a set of quantities describing its state (state variables) and to writing an operator that would transfer the indicator into a new state at the arrival of a new tick. Initialization of state variables becomes an essential part of the indicator algorithm. We will show how all this can be done at the example of ZigZags of a certain type.

Author: Candid

MQL4 Comments
16319
MQL4 Comments  
Dear Candid,

Can you please write comments in HZZ.mq4 and ZZTemplate.mq4 in english.

Thanks in advance.

Regards 

Rajat
MQL4 Comments
16319
MQL4 Comments  
Thanks a lot for this one, it realy helped me!
MQL4 Comments
16319
MQL4 Comments  
heelo candid,Thanks a million for this great article.please i would like to know how i can add codes to get the coordinates of a predefined number of preceding peaks, using arrays like you suggested.i need to get the values of the last three peaks.Thanks a million
Ankit Jain
468
Ankit Jain  
best timeframe for zig zag to use..reply??
Jean Marc VENET
143
Jean Marc VENET  

Hi guys,

I can translate from 'ru' to 'en' the comments, if needed, give me  about 2 or 3 hours. Interested ?

forextime8
528
forextime8  

Where can i download HZZ in mql5 ?

To add comments, please log in or register