Polarized Fractal Efficiency - интересный индикатор

 

На мой взгляд, достаточно интересный индикатор. Даёт не плохие результаты. Может кто сделает в MQL и выложит в Code Base для всех? В Code Base я смотрел - там не тот выложен.

Вот его формула -

Path1 = Sqrt( (Close – Close[Period])^2 + Period^2 )
Path2 = Sum(from i=0 to Period-1)Sqrt( (Close[i] – Close[i-1])^2 + 1 )
FractalEfficiencyTmp = Sign(Close – Close[Period]) * Path1 / Path2 * 100.0
FractalEfficiency = ExpMovAvg(FractalEfficiencyTmp, Smoothing Period),
where:
Close[Period] (or Close[i]) is Close Period (or i) bars back,
Sign(a) is +1 if a>0 and –1 if a<0,
Sqrt(a) is square root of a,
Sum is a summation operation,
ExpMovAvg is Exponential Moving Average over Smoothing Period bars.

Path1 is simply the hypotenuse of the big triangle formed by the current Close and Period bars ago Close. Path2 is the sum of hypotenuses of small triangles formed by each Close point.

Вот как он выглядит -

 
а что в нем хорошего? чет не разглядел?
 
kostas писал(а) >>
а что в нем хорошего? чет не разглядел?

Надо не разглядывать - надо пробовать оптимизировать. Я выложил со стандартными зачениями, не оптимизированными.

 
прежде чем возиться с переложением кода, хотелось бы все-таки разглядеть - чем интересен этот индикатор?
 
kostas писал(а) >>
прежде чем возиться с переложением кода
Да вроде он не сложный.... ))))
 
LeoV >>:

Да вроде он не сложный.... ))))

Извини, если непроизвольно обнадежил. Я кодить не буду. Может кто и заинтересуется.

 

Попробуем закодить.

Только поспать надо.

 
Вот здесь нашел.
Файлы:
 
//+------------------------------------------------------------------+
//|                                 Polarized_Fractal_Efficiency.mq4 |
//|                                                     Yuriy Tokman |
//|                                            yuriytokman@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Yuriy Tokman"
#property link      "yuriytokman@gmail.com"

#property indicator_separate_window

#property indicator_buffers 5
#property indicator_color1 Lime
#property indicator_color3 Indigo
#property indicator_color4 Teal
#property indicator_color5 Teal

#property indicator_level1 100
#property indicator_level2 80
#property indicator_level3 60
#property indicator_level4 40
#property indicator_level5 -40
#property indicator_level6 -60
#property indicator_level7 -80
#property indicator_level8 -100

extern string __настройки_нидикатора__ = "Здесь изменяем";
extern int Perriod = 9;
extern int period_MA = 5;//0-3

double FractalEfficiency[];
double Line_Zero[];
double Line_H20[];
double Line_L20[];
double FractalEfficiencyTmp[];
 

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,EMPTY,3);
   SetIndexBuffer(0,FractalEfficiency);
      
   SetIndexStyle(1,DRAW_NONE);
   SetIndexBuffer(1,FractalEfficiencyTmp);
   
   SetIndexStyle(2,DRAW_LINE,1,1);
   SetIndexBuffer(2,Line_Zero);
   
   SetIndexStyle(3,DRAW_LINE,2,1);
   SetIndexBuffer(3,Line_H20);   
            
   SetIndexStyle(4,DRAW_LINE,2,1);
   SetIndexBuffer(4,Line_L20);   

   IndicatorShortName("Polarized_Fractal_Efficiency ("+Perriod+")");
   
   SetIndexLabel(0," ISQ#481971287  ");
   SetIndexLabel(1," yuriytokman@gmail.com  ");      
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
   
   if(counted_bars<0) return(-1);

   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;

   for(int i=limit; i>=0; i--)
   {
//&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
     //Path1 = Sqrt( (Close – Close[Period])^2 + Period^2 )
     //Path2 = Sum(from i=0 to Period-1)Sqrt( (Close[i] – Close[i-1])^2 + 1 )
     //FractalEfficiencyTmp = Sign(Close – Close[Period]) * Path1 / Path2 * 100.0
     //FractalEfficiency = ExpMovAvg(FractalEfficiencyTmp, Smoothing Period),
     //where:
     //Close[Period] (or Close[i]) is Close Period (or i) bars back,
     //Sign(a) is +1 if a>0 and –1 if a<0,
     //Sqrt(a) is square root of a,
     //Sum is a summation operation,
     //ExpMovAvg is Exponential Moving Average over Smoothing Period bars.
     //Path1 is simply the hypotenuse of the big triangle formed by the current 
     //Close and Period bars ago Close. Path2 is the sum of hypotenuses of small 
     //triangles formed by each Close point.
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$  
    double Path1, Path2 = 0, a;
    Path1 = MathSqrt(MathPow(Close[i] - Close[i+Perriod],2)+MathPow(Perriod,2)); 
    for (int k=1; k<=Perriod; k++)
    Path2 += MathSqrt(MathPow(Close[i+k-1]-Close[i+k],2)+1);
     
    a = Close[i] - Close[i+Perriod];
    if (a>0) FractalEfficiencyTmp[i] = +1*Path1 / Path2 * 100.0;
    else     FractalEfficiencyTmp[i] = -1*Path1 / Path2 * 100.0;   
    }
    
    for(i=limit; i>=0; i--)
    {
     FractalEfficiency[i] = iMAOnArray(FractalEfficiencyTmp,0,period_MA,0,2,i);
     Line_Zero[i]= 0;
     Line_H20[i] = 20;
     Line_L20[i] =-20;
    }
//----
   return(0);
  }
//+------------------------------------------------------------------+
 
чем он лучше стохастика ?
 
:DD
Причина обращения: