//+------------------------------------------------------------------+ //| iUniMA_MTF.mq5 | //| Copyright © 2010, AK20 | //| traderak20@gmail.com | //| | //| Based on: | //| iUniMA.mq5 by Integer | //| MetaQuotes Software Corp. | //| http://dmffx.com | //+------------------------------------------------------------------+ #property copyright "2010, traderak20@gmail.com" #property description "iUniMA, Multi-timeframe of version the Universal Moving Average" #property version "1.03" /*-------------------------------------------------------------------- 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 //--- use this for calculations with PRICE_CLOSE, PRICE_HIGH, PRICE_LOW, PRICE_MEDIAN, PRICE_TYPICAL, PRICE_WEIGHTED 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 //--- use this for calculations with PRICE_OPEN 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