//+------------------------------------------------------------------+ //| MACD_Histogram_MTF_MC.mq5 | //| Copyright © 2010, AK20 | //| traderak20@gmail.com | //| | //| Based on: | //| MACD.mq5 | //| Copyright 2009, MetaQuotes Software Corp. | //| http://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "2010, traderak20@gmail.com" #property description "Moving Average Convergence/Divergence, Histogram, Multi-timeframe, Multi-color" /*-------------------------------------------------------------------- 2010 09 26: v03 Improved display of values on timeframes smaller than the chart's timeframe Set buffers to EMPTY_VALUE instead of 0 after: if(convertedTimerates_total) limit=rates_total-1; else limit=rates_total-prev_calculated; //--- create variable required to convert between TF1 and TF2 datetime convertedTime; //--- loop through TF1 bars to set buffer TF1 values for(int i=limit;i>=0;i--) { //--- convert time TF1 to nearest earlier time TF2 for a bar opened on TF2 which is to close during the current TF1 bar if(InpAppliedPrice!=PRICE_OPEN) convertedTime=Time[i]+PeriodSeconds_TF1-PeriodSeconds_TF2; //--- convert time TF1 to nearest earlier time TF2 for a bar opened on TF2 at the same time or before the current TF1 bar if(InpAppliedPrice==PRICE_OPEN) convertedTime=Time[i]; //--- check if TF2 data is available at convertedTime datetime tempTimeArray_TF2[]; CopyTime(NULL,InpTimeFrame_2,calculated_TF2-1,1,tempTimeArray_TF2); //--- no TF2 data available if(convertedTime