//+------------------------------------------------------------------+ //| TimeFuncions.mqh | //| Copyright 2011, MetaQuotes Software Corp. | //| http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2011, MetaQuotes Software Corp." #property link "http://www.mql5.com" //+------------------------------------------------------------------+ //| Function for determining the time of the first bar on a lower time frame| //| in a bar on a higher time frame | //+------------------------------------------------------------------+ bool LowerTFFirstBarTime(string aSymbol,ENUM_TIMEFRAMES aLowerTF,datetime aUpperTFBarTime,datetime &aLowerTFFirstBarTime) { datetime tm[]; //--- determine the bar time on a lower time frame corresponding to the bar time on a higher time frame if(CopyTime(aSymbol,aLowerTF,aUpperTFBarTime,1,tm)==-1) { return(false); } if(tm[0]=StartTime || aTimeCur=StartTime && aTimeCur=PointTime || aTimePre=PointTime && aTimePre=StartTime || TimeCur=StartTime && TimeCur