need help to simplify an indicator

 
Hello everyone,

I need to make this lighter indicator  because I want the program to ea


//+------------------------------------------------------------------+
//|                                                Repulse_lisse.mq4 |
//|                                                                  |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+

#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Yellow
#property indicator_color2 Lime
#property indicator_color3 Coral

//---- input parameters
extern int RepulsePeriod3=15;
extern int smooth = 100;
extern int peratr = 14;
//---- buffers
double Smooth_3[];

double Up[];
double Down[];

double RepulseBuffer3[];
double PosBuffer[];
double NegBuffer[];
double forceHaussiere, forceBaissiere;
double forceHaussieretmp1, forceBaissieretmp1;
double forceHaussieretmp2, forceBaissieretmp2;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init() {
string short_name;
short_name="Repulse_lisse("+RepulsePeriod3+")";
IndicatorShortName(short_name);
//---- indicators
IndicatorBuffers(6);
SetIndexBuffer(0, Smooth_3);
SetIndexBuffer(1, Up);
SetIndexBuffer(2, Down);

SetIndexBuffer(3,RepulseBuffer3);
SetIndexBuffer(4,PosBuffer);
SetIndexBuffer(5,NegBuffer);

SetIndexStyle(0, DRAW_LINE, STYLE_SOLID,2);
SetIndexStyle(1,DRAW_LINE, STYLE_SOLID,2);
SetIndexStyle(2,DRAW_LINE, STYLE_SOLID,2);
SetIndexStyle(3,DRAW_NONE);
SetIndexStyle(4,DRAW_NONE);
SetIndexStyle(5,DRAW_NONE);


SetLevelValue(0,0);
SetLevelStyle(STYLE_DOT,0,DimGray);

//----
return(0);
}

//+------------------------------------------------------------------+
//| iteration function |
//+------------------------------------------------------------------+
int start() {

int b;
if (smooth <1) smooth=1;


int index = 0;
int counted_bars=IndicatorCounted();

int limit = Bars - counted_bars;


// Repulse3
for(index=0;index<Bars;index++) {
PosBuffer[index] = ((((3*Close[index])-(2*getLow(index, RepulsePeriod3))-Open[index+RepulsePeriod3])/Close[index])*100);
NegBuffer[index] = (((Open[index+RepulsePeriod3]+(2*getHigh(index, RepulsePeriod3))-(3*Close[index]))/Close[index])*100);
}
for(index=0;index<limit;index++) {
if (Period()==1440)
{
b=iATR(NULL,0,peratr,index)*1000;
}
else
{
b=1;

}
force1 (RepulsePeriod3 * b,index);
force2 ((RepulsePeriod3 * b)/2,index);
forceHaussiere=forceHaussieretmp1-forceHaussieretmp2;
forceBaissiere=forceBaissieretmp1-forceBaissieretmp2;
RepulseBuffer3[index]=forceHaussiere-forceBaissiere;
 }
 
 
  //------------------------------------------------------
   int i, lim;
   if(counted_bars>0) counted_bars--;
    lim = Bars-counted_bars;
   for(i=0; i< lim ; i++)    Smooth_3[i]=iMAOnArray( RepulseBuffer3, Bars, smooth ,0,MODE_SMA,i);
  
   
    
     if(counted_bars>0) counted_bars--;
    lim = Bars-counted_bars;
  for(i=0; i< lim ; i++)
         {
   if ( Smooth_3[i]>  Smooth_3[i+1])
   {
                Up[i] = Smooth_3[i];
                 Down[i]=EMPTY_VALUE;   
                 }
      else if ( Smooth_3[i] <  Smooth_3[i+1])
      {
             Down[i]=  Smooth_3[i];
             Up[i] =EMPTY_VALUE;
          }
       
      else 
         {
         Down[i]=EMPTY_VALUE;         
         Up[i] =EMPTY_VALUE;
        }
   }

    
return(0);
}
//+---------------------------------------------------------------

//+------------------------------------------------------------------+
double getLow(int from, int period) {
double low = 9999999999;
for (int index=from; index<=from+period; index++) {
if (low > Low[index]) {
low = Low[index];
}
}
return (low);
}

double getHigh(int from, int period) {
double high = 0;
for (int index=from; index<=from+period; index++) {
if (high < High[index]) {
high = High[index];
}
}
return (high);
}


//---------------------------------------------+


void force1 (int per,int bar)
{
   double tmp1[];
   double tmp2[];
   int len =  MathSqrt(per);
   ArrayResize(tmp1,len);
   ArrayResize(tmp2,len);
   if(bar == per) 
   {
   for(int i = 0; i < len;i++) 
   {
   tmp1[len-i-1] = 2*LWMA(PosBuffer,per/2,bar-i) - LWMA(PosBuffer,per,bar-i); 
   tmp2[len-i-1] = 2*LWMA(NegBuffer,per/2,bar-i) - LWMA(NegBuffer,per,bar-i); 
   } 
   forceHaussieretmp1 = LWMA(tmp1,len,len-1); 
   forceBaissieretmp1 = LWMA(tmp2,len,len-1); 
   }
   else
   {
   if(bar > per)
   {
   for(i = 0; i < len;i++) 
   {
   tmp1[len-i-1] = 2*LWMA(PosBuffer,per/2,bar-i) - LWMA(PosBuffer,per,bar-i); 
   tmp2[len-i-1] = 2*LWMA(NegBuffer,per/2,bar-i) - LWMA(NegBuffer,per,bar-i); 
   } 
   forceHaussieretmp1 = LWMA(tmp1,len,len-1); 
   forceBaissieretmp1 = LWMA(tmp2,len,len-1); 
   }  
}


}

void force2 (int per,int bar)
{
   double tmp1[];
   double tmp2[];
   int len =  MathSqrt(per);
   ArrayResize(tmp1,len);
   ArrayResize(tmp2,len);
   if(bar == per) 
   {
   for(int i = 0; i < len;i++) 
   {
   tmp1[len-i-1] = 2*LWMA(PosBuffer,per/2,bar-i) - LWMA(PosBuffer,per,bar-i); 
   tmp2[len-i-1] = 2*LWMA(NegBuffer,per/2,bar-i) - LWMA(NegBuffer,per,bar-i); 
   } 
   forceHaussieretmp2 = LWMA(tmp1,len,len-1); 
   forceBaissieretmp2 = LWMA(tmp2,len,len-1); 
   } 

   
   else
   {
   if(bar > per)
   {
   for( i = 0; i < len;i++) 
   {
   tmp1[len-i-1] = 2*LWMA(PosBuffer,per/2,bar-i) - LWMA(PosBuffer,per,bar-i); 
   tmp2[len-i-1] = 2*LWMA(NegBuffer,per/2,bar-i) - LWMA(NegBuffer,per,bar-i); 
   } 
   forceHaussieretmp2 = LWMA(tmp1,len,len-1); 
   forceBaissieretmp2 = LWMA(tmp2,len,len-1); 
   }  
}
}


double LWMA(double array[],int per,int bar)
{
   double Sum = 0;
   double Weight = 0;
   
      for(int i = 0;i < per;i++)
      { 
      Weight+= (per - i);
      Sum += array[bar-i]*(per - i);
      }
   if(Weight>0) double lwma = Sum/Weight;
   else lwma = 0; 
   return(lwma);
} 
 
 
offset: I need to make this lighter indicator  because I want the program to ea
  1. You don't change the indicator, you write the EA and get the values via iCustom.
  2. Since there are no slaves here, you have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt and the nature of your problem.
Reason: