Is there a way i can take the values of open and close of every minute from 0000 to 0015 and then for next 15 minutes and so on. without writing a loop with a difference of 15 mins. Is there any such function in mql4. pardon me for my ignorance.
- Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6.
- How to Specify a Different Trade Closing Time than the Chart Interval?
- PROBLEM CODE
MQL4 has no built in fumction that does that you would have to code it.
Your question makes no sense. Take the values where, why. Why don't you want a loop. What is a difference of 15 minutes from/to what?
@SDC:fine got it thanks.
@whroeder: i wanted the values of open and close prices in intervals of 15 mins. the values of open and close from 0000 to 0015 hours. similarly the the values of open and close from 0015 to 0030. sets of open close data.
You can record them in real time to a file if you dont want to use a loop.
cryptex: i wanted the values of open and close prices in intervals of 15 mins. the values of open and close from 0000 to 0015 hours. similarly the the values of open and close from 0015 to 0030. sets of open close data.
#define HR2400 86400 // 24 * 3600 int TimeOfDay(datetime when){ return( when % HR2400 ); } datetime DateOfDay(datetime when){ return( when - TimeOfDay(when) ); } //datetime Today(){ return(DateOfDay( TimeCurrent() )); } //datetime Tomorrow(){ return(Today() + HR2400); } //datetime Yesterday(){ return( iTime(NULL, PERIOD_D1, 1) ); } datetime now = TimeCurrent(), HR000 = DateOfDay(now), HR015 = HR000 + 900; // 15 * 60 int iHR00 = iBarShift(NULL, PERIOD_M1, HR000), iHR15 = iBarShift(NULL, PERIOD_M1, HR015; double OpenM1[15]; for(int iM1 = iHR00; iM1 < iHR15; iM1++) OpenM1[iM1-iHR00] = iOpen(NULL, PERIOD_M1, iM1);
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register