istogramma di ehlers fisher
//+--------------------+
//| Trasformazione di Fisher di Ehlers.
//| mladen |
//+--------------------+
#proprietà copyright "mladen"
#proprietà indicatore_finestra_separata
#proprietà indicatore_buffer 5
#proprietà indicatore_colore1 Verde
#property indicator_color2 Verde
#proprietà indicatore_colore3 Rosso
#proprietà indicatore_colore4 Rosso
#proprietà indicatore_colore5 DimGrigio
#proprietà indicatore_larghezza1 2
#proprietà indicatore_larghezza3 2
#proprietà indicatore_larghezza5 2
//
//
//
//
//
extern int period = 10;
extern int PriceType = PRICE_MEDIAN;
//
//
//
//
//
double buffer1[];
double buffer2[];
double buffer3[];
doppio buffer4[];
doppio buffer5[];
double Prezzi[];
doppio Valori[];
//+--------------------+
//| |
//+--------------------+
//
//
//
//
//
init()
{
IndicatorBuffers(7);
SetIndexBuffer(0,buffer1); SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexBuffer(1,buffer2); SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexBuffer(2,buffer3); SetIndexStyle(2,DRAW_HISTOGRAM);
SetIndexBuffer(3,buffer4); SetIndexStyle(3,DRAW_HISTOGRAM);
SetIndexBuffer(4,buffer5);
SetIndexBuffer(5,Prezzi);
SetIndexBuffer(6,Valori);
IndicatorShortName("Ehlers\' Fisher transform ("+periodo+")");
ritorno(0);
}
//+--------------------+
//| |
//+--------------------+
//
//
//
//
//
int start()
{
int counted_bars=IndicatorCounted();
int i,limite;
if(counted_bars < 0) return(-1);
if(counted_bars > 0) counted_bars-;
limite = Barre contate_barre;
//
//
//
//
//
for(i=limite; i>=0; i-)
{
Prezzi[i] = iMA(NULL,0,1,0,MODE_SMA,PriceType,i);
//
//
//
//
//
double MaxH = Prezzi[ArrayMaximum(Prezzi,periodo,i)];
double MinL = Prezzi[ArrayMinimum(Prezzi,periodo,i)];
se (MaxH!=MinL)
Values[i] = 0.33*2*((Prices[i]-MinL)/(MaxH-MinL)-0.5)+0.67*Values[i+1];
altrimenti Valori[i] = 0,00;
Valori[i] = MathMin(MathMax(Valori[i],-0,999),0,999);
buffer5[i] = 0.5*MathLog((1+Values[i])/(1-Values[i]))+0.5*buffer5[i+1];
//
//
//
//
//
if(buffer5[i]==buffer5[i+1])
{
buffer1[i]=buffer1[i+1];
buffer2[i]=buffer2[i+1];
buffer3[i]=buffer3[i+1];
buffer4[i]=buffer4[i+1];
continuare;
}
//
//
//
//
//
buffer1[i]=EMPTY_VALUE;
buffer2[i]=EMPTY_VALUE;
buffer3[i]=EMPTY_VALUE;
buffer4[i]=EMPTY_VALUE;
se(buffer5[i]<0)
{
se (buffer5[i]<buffer5[i+1]) buffer3[i]=buffer5[i];
se (buffer5[i]>buffer5[i+1]) buffer4[i]=buffer5[i];
}
se(buffer5[i]>0)
{
se (buffer5[i]<buffer5[i+1]) buffer2[i]=buffer5[i];
se (buffer5[i]>buffer5[i+1]) buffer1[i]=buffer5[i];
}
}
ritorno(0);