Help with icustom() Buffer

 

Hi, i have to get the last 6 buffer in the chart and associate it at some variable. 

The indicator have buffer 0=!EMPTY_VALUE.

 

I try in this way but nothing.

 

int n = 0;

  int i = 0;

  double p[6];

  while( n < 6) {

   temp = iCustom(NULL,0,"1",0,i);

   if(temp != EMPTY_VALUE) {

      p[n] = temp;

      n++;

   }

   i++;             

}

   

 if (p[6]<p[4] && p[5]>p[6] && p[5]>p[4] && p[2]>p[4] && p[1]<p[3]){  
 
ANTAR:

Hi, i have to get the last 6 buffer in the chart and associate it at some variable. 

The indicator have buffer 0=!EMPTY_VALUE.

So you Indicator name is  1 ,  you aare happy with the default extern values that the Indicator has  and you are interested in the value from bar 0 or maybe bar 1, 2, etc . . .
 
The indicator create the signal in the chart, it haven't external value . I need to associate the signal value for the previous six signal from now.
 
ANTAR:
The indicator create the signal in the chart, it haven't external value . I need to associate the signal value for the previous six signal from now.

Which buffer has the signal you want?  one buffer ?  any buffer ?  what is the name of the Indicator ?
 
The name of the indicator is 1. I downloaded it to internet. I must register the value buffer when it is =!EMPTY_VALUE because when the rule of the indicator are find it put in the buffer 0 the value of the price . 
 
Here there is the indicator 1...
Files:
1.mq4  7 kb
 
ANTAR:
Here there is the indicator 1...
So the Indicator has 3 buffers  . . . not 6,  and only 2 of the buffers are output to the chart.

So you need buffer 0 and buffer 1.
 

I want to register in 6 variable . the last 6 signal.

with this rules .

if buffer0 =! EMPTY_VALUE 

if buffer 0 < buffer1  the value of buffer 0 must  to be registered in low1,low2 for the other signal,and low3 for the last one

or

if buffer0 =! EMPTY_VALUE 

if buffer0>buffer 1 the value of buffer 0 must to be registered in high1,high2 for the other signal,high3 for the last one..

 
ANTAR:

I want to register in 6 variable . the last 6 signal.

with this rules .

if buffer 0 < buffer1  the value of buffer 0 must  to be registered in low1,low2,low3

and if buffer0>beffer 1 the value of buffer 0 must to be registered in high1,high2,high3.

You need to change your code,  it is only looking at buffer 0  . . . try again.
 

it can be the solution?

int start()
  {
   double temp = 0;
   double temp1 = 0;
   int count = 0;
  int n = 0;
  int i = 0;
   int a = 0;
  int e = 0;
  double PointLow[3];
  double PointHigh[3];
  while( n < 3) {
   temp = iCustom(NULL,0,"1",0,i);
   temp1 = iCustom(NULL,0,"1",1,i);
   if(temp != EMPTY_VALUE && temp<temp1) {
    
      PointLow[n] = temp;
      n++;
   }
   i++;             
}
     while( a < 3) {
   temp = iCustom(NULL,0,"1",0,e);
   temp1 = iCustom(NULL,0,"1",1,e);
   if(temp != EMPTY_VALUE && temp<temp1) {
    
      PointHigh[a] = temp;
      a++;
   }
   e++;             
}
 
//----

      
                                       
   return(0);
  }
 
ANTAR:

it can be the solution?

Why did you write code and change the Indicator name from "1" to "TTM scalper" ?
Reason: