Download MetaTrader 5

Value of a particular candle

To add comments, please log in or register
Uncl3B0B
29
Uncl3B0B  
I need to get the value of a particular candle, for example H1 10:00 today or the previous day. How do I get the size anytime during the day, Low, High, some specific candle?

whroeder1
15574
whroeder1  
Get the shift for the time you want. Then get what you want from that candle.
#define SECONDS         int
#define HR2400          86400 // PERIOD_D1 * 60
SECONDS    time(datetime when=0){
   return SECONDS((when == 0) ? TimeCurrent() : when) % HR2400;                }
datetime   date(datetime when=0){
   return ((when == 0) ? TimeCurrent() : when) - time(when);                   }
///////
#define HR1000 36000 // 10 AM
datetime when = date() + HR1000;
int      iBar = iBarShift(NULL,0, when);
double   h = High[iBar];
Uncl3B0B
29
Uncl3B0B  

Thanks for info. 

MQL can not, so your design can not be used. But we helped iBarShift command that I used to what is already known and works it. 

 

   double A = iHigh(NULL,PERIOD_M1,iBarShift(NULL,PERIOD_M1,D'10:31'));         
   double B = iLow (NULL,PERIOD_M1,iBarShift(NULL,PERIOD_M1,D'10:31'));
   double X = A - B;  // size candle M1 10:31 today

 

THX for idea 

To add comments, please log in or register