Time to iCostum

 

hello, I should take the time to iCustom and Candle [1+i]. It might go like this? The code does not return errors but are not sure


datetime Candela1(int s)
  {
   int i= 0;   
   double Candela=0;
   datetime time=0;   
   
      Candela= Close[i];      
      
      if(Candela!=0.0&&time==0) {time=Time[i];} 
     //}
   return(time);
  }
 
datetime Candela1(int s)            //Where do you use the variable s ??

Your code is basically

datetime Candela1()
  {
   return(Time[0]);
  }

so just use Time[0] in your code instead of the function call.

 

For the first time the candle? I write the code so?

datetime Candela1()
  {
   return(Time[1]);
  }

If I wanted to take the time iCustom ()?

datetime Candela1()
  {
   iCustom() //is correct?
   return(Time[1]);
  }
 
fly7680:

For the first time the candle? I write the code so?

If I wanted to take the time iCustom ()?

iCustom returns the value of the indicator buffers, it doesn't return a time.
 
GumRai:
iCustom returns the value of the indicator buffers, it doesn't return a time.


how can I put time of the Zigzag indicator?
 

If you want to code an EA, you should know how MT4 handels bar values (time/open/high/low/close).

Therefore please read the documentation and than start to code.

 
fly7680:


how can I put time of the Zigzag indicator?

Look back through the buffer until you find a value

Find the time of the buffer index

 
Next time don't start a new thread, continue your previous one.
Reason: