Download MetaTrader 5

Time to iCostum

To add comments, please log in or register
No time to learn MQL5? The source code library is at your service!
fly7680
503
fly7680 2016.10.23 19:59 

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);
  }
Keith Watford
Moderator
9614
Keith Watford 2016.10.23 20:36  
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.

fly7680
503
fly7680 2016.10.24 04:24  

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]);
  }
Keith Watford
Moderator
9614
Keith Watford 2016.10.24 04:59  
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.
fly7680
503
fly7680 2016.10.24 05:12  
GumRai:
iCustom returns the value of the indicator buffers, it doesn't return a time.


how can I put time of the Zigzag indicator?
peter.MT4Web
158
peter.MT4Web 2016.10.24 07:59  

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.

Keith Watford
Moderator
9614
Keith Watford 2016.10.24 08:03  
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

whroeder1
14480
whroeder1 2016.10.24 12:07  
Next time don't start a new thread, continue your previous one.
To add comments, please log in or register