EA based on arrows

 

hi im trying to make ea to trade based on custom indicator arrows , but is not working , what i do wrong ?

INDICATOR ARROWS VALUES

trend[i] = 0;
      if (T3RSIBuffer[i]>LowBuffer[i]  && T3RSIBuffer[i+1] <= LowBuffer[i+1])   trend[i] = 1;
      if (T3RSIBuffer[i]<HighBuffer[i] && T3RSIBuffer[i+1] >= HighBuffer[i+1])  trend[i] =-1;  


MY EA Icustom VALUES FOR THE ARROWS

 CandleDirection = none;
  if  (iCustom (NULL,0,"RA" , 2, 0)> iCustom (NULL,0,"RA" , 1, 0) && iCustom (NULL,0,"RA" , 2, 1)<= iCustom (NULL,0,"RA" , 1, 1)  ) CandleDirection = up;
  if  (iCustom (NULL,0,"RA" , 2, 0)<  iCustom (NULL,0,"RA" , 0, 0) && iCustom (NULL,0,"RA" , 2, 1)>= iCustom (NULL,0,"RA" , 0, 1) ) CandleDirection = down; 

Files:
RA.mq4  9 kb
 
Dimitar Pavlov: what i do wrong ?
  1. Don't hard code the indexes, make an enumeration so you can understand the code later.

    Indicator
     buffers
       SetIndexBuffer(0,ZigZagBuffer);
       SetIndexBuffer(1,HighBuffer);
       SetIndexBuffer(2,LowBuffer);
       SetIndexBuffer(3,T3RSIBuffer);
       SetIndexBuffer(4,ZigZagLow);
       SetIndexBuffer(5,ZigZagHigh);
       SetIndexBuffer(6,trend);
    
    enum RAbuffers{ ZigZagBuffer, HighBuffer, LowBuffer, T3RSIBuffer, ZigZagLow, ZigZagHigh, trend }
    
  2.  if  (iCustom (NULL,0,"RA" , 2, 0)> iCustom (NULL,0,"RA" , 1, 0) && iCustom (NULL,0,"RA" , 2, 1)<= iCustom (NULL,0,"RA" , 1, 1)  ) CandleDirection = up;

    Are your books one column but two feet wide? No because that is unreadable. They are 6 inches, sometimes two columns, so you can read it easily. So should be your code. I'm not going to go scrolling (or moving my eyes) back and forth trying to read it. Don't copy and paste code, write self documenting code.

  3. double lowCur =iCustom (NULL,0,"RA" , LowBuffer,  0);
    double highCur=iCustom (NULL,0,"RA" , HighBuffer, 0); 
    double lowPre= iCustom (NULL,0,"RA" , LowBuffer,  1);
    double higPre =iCustom (NULL,0,"RA" , HighBuffer, 1);
    if(lowCur> highCur && lowPre<= highpre)
    When is the low ever going to be above the high?

  4. You showed the indicator trend[]? Why? are you reading it?

 
William Roeder #:
  1. Don't hard code the indexes, make an enumeration so you can understand the code later.

    Indicator
     buffers
  2. Are your books one column but two feet wide? No because that is unreadable. They are 6 inches, sometimes two columns, so you can read it easily. So should be your code. I'm not going to go scrolling (or moving my eyes) back and forth trying to read it. Don't copy and paste code, write self documenting code.

  3. When is the low ever going to be above the high?

  4. You showed the indicator trend[]? Why? are you reading it?

no i dont read   the indicator trend[] , what should i do so so my EA can read it ?

 
Dimitar Pavlov #: what should i do so so my EA can read it ?

You code it to do so.