Search This Blog

Friday

Indicator ZigZag on Parabolic SAR


Author: Svinozavr

In this implementation forex indicator zigzag as the threshold of sensitivity is used Parabolic.

In a typical zigzag definition extrema occur when the price of care extremum for some threshold, usually set in points or%% price extremum.

Here, in contrast to the usual zigzag, with a fixed threshold, the threshold is dynamic. Complete analogy with the method set stoploss - and the fixed trailing.

Other features:

- Work at zero bar. Most implementations use only fully formed bars. Here, after crossing the threshold price (the coup Paraboliс), the indicator is not waiting for the next bar to otrisovat extreme.

- The implementation of zigzag, where the opposite extremes can be identified at a bar (the vertical segment), there are problems with the priority of these extremes. Normally, priority is set based on the market inertia that is not always the case. In this zigzag this is not a problem - all clearly defined Parabolikoс. Another point is how the case is included in MT4 Parabolik.))) But this is not me - the "birthright" of extremes, I shifted to it. And he seems to cope ...

- The code for the revaluation of history, and missed the penultimate bar uses is not an option IndicatorCounted (), and replacing its construction. The logic of its work, in principle, similar to IndicatorCounted (), but more clear.

 static int  BarsPrev ; // значение Bars на пред.баре static int BarsPrev; / / Bars on the importance pred.bare
bool MissBars = Bars - BarsPrev > 1 ; // 1 - есть пропущенные бары bool MissBars = Bars - BarsPrev> 1 / / 1 - is the missing bars
if ( MissBars & & BarsPrev ! = 0 ) BarsPrev = 0 ; // проущенные бары в процессе - пересчет заново if (MissBars & & BarsPrev! = 0) BarsPrev = 0; / / prouschennye bars in the process - re-recount

int limit = Bars - BarsPrev - ( BarsPrev = = 0 ) ; // кол-во пересчетов int limit = Bars - BarsPrev - (BarsPrev = = 0) / / number of recalculations
BarsPrev = Bars ; // обновление BarsPrev BarsPrev = Bars; / / update BarsPrev

for ( int i = limit ; i > = 0 ; i - - ) // цикл по непосчитанным и предпоследнему барам for (int i = limit; i> = 0; i - -) / / cycle neposchitannym and penultimate bars
{ (

Параметры форекс -индикатора (первые два) идентичны параметрам Параболика стандартной поставки MT4. Options forex indicator (first two) are identical to the standard delivery options Parabolika MT4.

Added features:

- ExtremumsShift - defines the position of extrema on the time axis: the time of their identification (false) or at the actual state (true).

- History - well, it is understandable. However, the indicator is considered very fast, so this option can be removed altogether. Like the previous - is rather an illustration of a way of catching extrema than something useful. Although ... Either way, remove the ads from these variables extern always.

ExtremumsShift = true Extremes at their actual locations

Forex Indicators


ExtremumsShift = false Extremes for the time of their definition

Forex Indicators

Download forex - indicator ZigZag on Parabolic SAR

No comments: