Indicators: Advanced_Fractal_Envelopes

 

Advanced_Fractal_Envelopes:

Indicator Advanced Fractal Envelopes

Advanced_Fractal_Envelopes

Author: Scriptor

 

AVG in this case is SMA (Simple MA)? Just to clarify.

And it can be replaced by any other MA ?

 
Urman Ru #:

AVG in this case is SMA (Simple MA)? Just to clarify .

And it can be replaced by any other MA ?

Well, according to the calculation, it's a simple SMA. But to replace it with another one, you will have to make either a new correct calculation of another MA, or use another buffer - a calculation buffer to calculate another MA using iMA

 
Artyom Trishkin #:

Well, according to the calculation, it is a simple SMA. But to replace it with another one, we will have to make either a new correct calculation of another MA, or use another buffer - a calculation buffer to calculate another MA using iMA

Thank you. My unnecessary doubts are gone).

 
Is it possible to change the indicator code so that the lines do not "fall"? I understand that it is because of the fractal. It is very inconvenient to constantly overload the indicator. Is it so in all "fractal" indicators or only in this particular one?
Files:
 
Urman Ru #:
Is it possible to change the indicator code so that the lines do not "fall"? I understand that it is because of the fractal. It is very inconvenient to constantly overload the indicator. Is it so in all "fractal" indicators or only in this particular one?

Maybe. I haven't looked into the code, but it is usually solved by pre-initialisation of all buffers being drawn with an empty value on each tick. First, the buffers are filled with values that are used in the indicator as "empty", and then the main calculation of the indicator is performed.

 
Artyom Trishkin #:

Maybe. I haven't looked into the code, but this is usually solved by preliminary initialisation of all buffers being drawn with an empty value on each tick. First, the buffers are filled with values that are used in the indicator as "empty", and then the main calculation of the indicator is performed.

Tired?

 
Artyom Trishkin #:

Maybe. I haven't looked into the code, but usually it is solved by preliminary initialisation of all drawn buffers with an empty value on each tick. First, the buffers are filled with values that are used in the indicator as "empty", and then the main calculation of the indicator is performed.

Thank you. Can you give me an example of such an indicator or at least a "piece" of code from it? Or where can I read more about it?

 
Urman Ru #:

Thank you. Can you give me an example of such an indicator or at least a "piece" of code from it? Or where can I read more about it?

Try adding these lines to the code:

//--- Calculating the indicator
   for(int i=limit; i>=0 && !IsStopped(); i--)
     {
      BufferTop[i]=EMPTY_VALUE;
      BufferCentral[i]=EMPTY_VALUE;
      BufferBottom[i]=EMPTY_VALUE;
      BufferFractUP[i]=EMPTY_VALUE;
      BufferFractDN[i]=EMPTY_VALUE;
      double average=0, fractal=BufferFractUP[i];
      int k=1,total=1;
      if(fractal>0 && fractal<EMPTY_VALUE)
        {
         average=fractal;
      //--- Average
         while(total<period_avg && i+k<rates_total-2)
           {
 
Artyom Trishkin #:

Try adding these lines to the code:

Thank you! I think I'm starting to understand something).