//+------------------------------------------------------------------+ //| Stochastic_MTF.mq5 | //| Copyright © 2010, AK20 | //| traderak20@gmail.com | //+------------------------------------------------------------------+ #property copyright "2010, traderak20@gmail.com" #property description "Stochastic, Multi-timeframe" /*-------------------------------------------------------------------- 2010 09 26: v04 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 convertedTime=Time[i]+PeriodSeconds_TF1-PeriodSeconds_TF2; //--- 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