Help with icustom() Buffer - page 3

 

Ok i found the issue.

I must check if buffer 0 is = at high or low of the candle.

So i try this but maybe i did a mistake because it not run properly.

Can you help me?

extern int PeriodoFiltro = 240; 
extern int PeriodoOperativo = 60;


double p1,p3,p4;
datetime p2;
int count = 0;
double oldBarOpen;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   oldBarOpen = Open[0];
   string symbol =Symbol();
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
if(oldBarOpen != Open[0]){

oldBarOpen = Open[0];
double temp = 0;
   for(int i = 0 ; i < 1500 ; i++)
   {
      temp = iCustom(NULL,0,"1",0,i);
      if (temp != EMPTY_VALUE) count = count+1;
      if(count == 1 && temp != EMPTY_VALUE) {p1=temp;p2=Time[i];}
      if(count == 2) break;
   }   
 int y =iBarShift(Symbol(),0,p2);  
 p3=iHigh(Symbol(),0,y);
 p4=iLow(Symbol(),0,y);

 //+------------------------------------------------------------------+
 //ELABORAZIONE RISULTATO FINALE
 //+------------------------------------------------------------------+ 
 if(p1==p4){

          OrderSend(Symbol(),OP_BUY,0.1,Ask,2,p1-40*Point,Bid+100*Point); }
  if(p1==p3){       
          OrderSend(Symbol(),OP_SELL,0.1,Bid,2,p1+40*Point,Ask-100*Point);}
 
 //---------------------------------------------------------------------------------------------------
 
   return(0);
  }
}
 
ANTAR:

Ok i found the issue.

I must check if buffer 0 is = at high or low of the candle.

So i try this but maybe i did a mistake because it not run properly.

You get alternate highs and lows so check each value compared to the one before . . .
 
RaptorUK:
You get alternate highs and lows so check each value compared to the one before . . .


For to be more clear....The indicator 1 create signal after n bars 2 to 5. I have to check if in the bars where there is the signal the buffer0 is = at high or low of the same bars.

I try registering the time and the i factor. But nothing.

 

Your EA code seems to be correct. All is wrong with your indicator code.

See: On the specified candle signal, The Red buffer (Value2) must be empty and DeepSkyBlue Buffer will not be EMPTY .. but on that candle it showing you both RED and DEEPSKYBLUE not EMPTY.

Now if you successfully implement it then how to decide that it was a BUY or SELL signal? So first update your indicator code then I can tell how to access it through iCustom function using looping for previous bars checks.