How to get high of a certain time period

Back to topics list To post a new topic, please log in or register
avatar
2
bxchen 2015.01.20 18:27
 

How to get high of a certain time period

 

 I want to get the high for e.g time of my forex broker

from 00:00:00 to 00:02:00

I want get the iHighest for the time period of 00:00:00 to 00:02:00 for Today

 

How do I achieve it , sorry for asking and thanks for helping !

 

avatar
164
rod178 2015.01.20 19:00 #
 

 

Read the documentation, such as - 

 

https://docs.mql4.com/series/ihighest             to find the shift 

then use  

 https://docs.mql4.com/series/ihigh               on the shift to find the high of the bar


avatar
12985
WHRoeder 2015.01.21 18:43 #
 

bxchen:

How to get high of a certain time period

I want to get the high for e.g time of my forex broker

from 00:00:00 to 00:02:00

I want get the iHighest for the time period of 00:00:00 to 00:02:00 for Today

How do I achieve it , sorry for asking and thanks for helping !

  1. Get the starting/ending times.
  2. Get the starting/ending bar index
  3. Get the high for the range.
  4. learn to code and the available functions

#define HR2400 (PERIOD_D1 * 60)  // 86400 = 24 * 3600
int      TimeOfDay(datetime when=0){      if(when == 0)  when = TimeCurrent();
                                          return( when % HR2400 );            }
datetime DateOfDay(datetime when=0){      if(when == 0)  when = TimeCurrent();
                                          return( when - TimeOfDay(when) );   }
//datetime Tomorrow( datetime when=0){      if(when == 0)  when = TimeCurrent();
//                                          return(DateOfDay(when) + HR2400);   }
//datetime Yesterday(datetime when=0){      if(when == 0)  when = TimeCurrent();
//   int iD1 = iBarShift(NULL, PERIOD_D1, DateOfDay(when) - 1);
//                                       return( iTime(NULL, PERIOD_D1, iD1) ); }

#define HR0000 0
#define HR0002 (2*60)  // 00:02:00
datetime bod=DateOfDay();
int iM1Bod = iBarShift(NULL, PERIOD_M1, bod + HR0000);
int iM102  = iBarShift(NULL, PERIOD_M1, bod + HT0002 -1); // [0:00 - 0:02)
int iM1HH  = iHighest( NULL, PERIOD_M1, iM102 - iM1Bod + 1, iM1Bod);
double M1HH= iHigh(NULL, PERIOD_M1, iM1HH);

avatar
5
gregkevin 2015.01.29 15:37 #
 
I don't know about this and also want to know .  I think it is a good strategy.
Back to topics list  

To add comments, please log in or register