3 Timeframe Indicator Indicator For MT4

3 Timeframe Indicator Indicator For MT4

The 3 Timeframe Indicator Indicator For MT4 represent critical data related to CCI, MACD, RSI, and Stochastic. All these data are calculated based on three important time frames and present in the form of a histogram. Bars generating above the reference line indicators bullish momentum and when it generates below the reference line, it indicators selling momentum.

FREE 3 Timeframe Indicator Indicator

Download the FREE 3 Timeframe Indicator Indicator for MT4.

To receive my email 100% sure: 
Put my email on your whitelist!

 

Partially Automated Trading Besides Your Day Job

Alerts In Real-Time When Divergences Occur

My Recommended MT4/MT5 Broker

 

Installing the 3 Timeframe Indicator Indicator For MT4

After you downloaded the indicator via the form above you need to unzip the zip-file. Then you need to copy the file 3TimeFrameIndicator.mq4 into the folder MQL4\Indicators of your MT4 installation. After that please restart MT4 and then you will be able to see the indicator in the list of indicators.

Parameters of the 3 Timeframe Indicator Indicator For MT4

The 3 Timeframe Indicator Indicator For MT4 has 16 parameters to configure.

input indicators Indicator=INDICATOR_MACD;
input int InpFastEMA=12;   // Fast EMA Period
input int InpSlowEMA=26;   // Slow EMA Period
input int InpSignalSMA=9;  // Signal SMA Period
input int InpKPeriod=5; // K Period
input int InpDPeriod=3; // D Period
input int InpSlowing=3; // Slowing
input int InpRSIPeriod=8; // RSI Period
input int InpRSISignal=3; // RSI Signal
input int InpCCIPeriod=14; // CCI Period
input int InpCCISignal=3; // CCI Signal
input ENUM_APPLIED_PRICE InpPrice=PRICE_CLOSE;
input ENUM_TIMEFRAMES TimeFrame_1=PERIOD_M15;
input ENUM_TIMEFRAMES TimeFrame_2=PERIOD_H1;
input ENUM_TIMEFRAMES TimeFrame_3=PERIOD_H4;
input int BarsToCount=30;

Buffers of the 3 Timeframe Indicator Indicator For MT4

The 3 Timeframe Indicator Indicator For MT4 provides 9 buffers.

SetIndexBuffer(0,IndexBuffer_1A);
SetIndexBuffer(1,IndexBuffer_1B);
SetIndexBuffer(2,SignalBuffer_1);
SetIndexBuffer(3,IndexBuffer_2A);
SetIndexBuffer(4,IndexBuffer_2B);
SetIndexBuffer(5,SignalBuffer_2);
SetIndexBuffer(6,IndexBuffer_3A);
SetIndexBuffer(7,IndexBuffer_3B);
SetIndexBuffer(8,SignalBuffer_3);

Main Parts Of The Code

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   int i,j,k,limit;
//---
   if(rates_total lt =BarsToCount || !ExtParameters)
      return(0);
//--- last counted bar will be recounted
   limit=rates_total-prev_calculated;
   if(prev_calculated==0)
     {
      for(i=0;i lt rates_total;i++)
        {
         IndexBuffer_1A[i]=EMPTY_VALUE;
         IndexBuffer_1B[i]=EMPTY_VALUE;
         SignalBuffer_1[i]=EMPTY_VALUE;
         IndexBuffer_2A[i]=EMPTY_VALUE;
         IndexBuffer_2B[i]=EMPTY_VALUE;
         SignalBuffer_2[i]=EMPTY_VALUE;
         IndexBuffer_3A[i]=EMPTY_VALUE;
         IndexBuffer_3B[i]=EMPTY_VALUE;
         SignalBuffer_3[i]=EMPTY_VALUE;
        }
      limit=BarsToCount;
     }
   if(prev_calculated gt 0 && NewBar(time[0]))
     {
      limit=BarsToCount;
      IndexBuffer_1A[limit+1]=EMPTY_VALUE;
      IndexBuffer_1B[limit+1]=EMPTY_VALUE;
      SignalBuffer_1[limit+1]=EMPTY_VALUE;
      IndexBuffer_2A[limit*2+5]=EMPTY_VALUE;
      IndexBuffer_2B[limit*2+5]=EMPTY_VALUE;
      SignalBuffer_2[limit*2+5]=EMPTY_VALUE;
      IndexBuffer_3A[limit*3+9]=EMPTY_VALUE;
      IndexBuffer_3B[limit*3+9]=EMPTY_VALUE;
      SignalBuffer_3[limit*3+9]=EMPTY_VALUE;
     }
   if(prev_calculated gt 0)
      limit++;
//--- 
   for(i=0,j=BarsToCount+4,k=BarsToCount*2+8; i lt limit; i++,j++,k++)
     {
      switch(Indicator)
        {
         case INDICATOR_MACD:
            Index_1=iMacd(NULL,TimeFrame_1,InpFastEMA,InpSlowEMA,InpSignalSMA,InpPrice,MODE_MAIN,i);
            Signal1=iMacd(NULL,TimeFrame_1,InpFastEMA,InpSlowEMA,InpSignalSMA,InpPrice,MODE_SIGNAL,i);

            Index_2=iMacd(NULL,TimeFrame_2,InpFastEMA,InpSlowEMA,InpSignalSMA,InpPrice,MODE_MAIN,i);
            Signal2=iMacd(NULL,TimeFrame_2,InpFastEMA,InpSlowEMA,InpSignalSMA,InpPrice,MODE_SIGNAL,i);

            Index_3=iMacd(NULL,TimeFrame_3,InpFastEMA,InpSlowEMA,InpSignalSMA,InpPrice,MODE_MAIN,i);
            Signal3=iMacd(NULL,TimeFrame_3,InpFastEMA,InpSlowEMA,InpSignalSMA,InpPrice,MODE_SIGNAL,i); break;

         case INDICATOR_STOCHASTIC:
            Index_1=iStoch(NULL,TimeFrame_1,InpKPeriod,InpDPeriod,InpSlowing,0,MODE_MAIN,i);
            Signal1=iStoch(NULL,TimeFrame_1,InpKPeriod,InpDPeriod,InpSlowing,0,MODE_SIGNAL,i);

            Index_2=iStoch(NULL,TimeFrame_2,InpKPeriod,InpDPeriod,InpSlowing,0,MODE_MAIN,i);
            Signal2=iStoch(NULL,TimeFrame_2,InpKPeriod,InpDPeriod,InpSlowing,0,MODE_SIGNAL,i);

            Index_3=iStoch(NULL,TimeFrame_3,InpKPeriod,InpDPeriod,InpSlowing,0,MODE_MAIN,i);
            Signal3=iStoch(NULL,TimeFrame_3,InpKPeriod,InpDPeriod,InpSlowing,0,MODE_SIGNAL,i); break;

         case INDICATOR_RSI:
            Index_1=iRSi(NULL,TimeFrame_1,InpRSIPeriod,InpRSISignal,InpPrice,MODE_MAIN,i);
            Signal1=iRSi(NULL,TimeFrame_1,InpRSIPeriod,InpRSISignal,InpPrice,MODE_SIGNAL,i);

            Index_2=iRSi(NULL,TimeFrame_2,InpRSIPeriod,InpRSISignal,InpPrice,MODE_MAIN,i);
            Signal2=iRSi(NULL,TimeFrame_2,InpRSIPeriod,InpRSISignal,InpPrice,MODE_SIGNAL,i);

            Index_3=iRSi(NULL,TimeFrame_3,InpRSIPeriod,InpRSISignal,InpPrice,MODE_MAIN,i);
            Signal3=iRSi(NULL,TimeFrame_3,InpRSIPeriod,InpRSISignal,InpPrice,MODE_SIGNAL,i); break;

         case INDICATOR_CCI:
            Index_1=iCCi(NULL,TimeFrame_1,InpCCIPeriod,InpCCISignal,InpPrice,MODE_MAIN,i);
            Signal1=iCCi(NULL,TimeFrame_1,InpCCIPeriod,InpCCISignal,InpPrice,MODE_SIGNAL,i);

            Index_2=iCCi(NULL,TimeFrame_2,InpCCIPeriod,InpCCISignal,InpPrice,MODE_MAIN,i);
            Signal2=iCCi(NULL,TimeFrame_2,InpCCIPeriod,InpCCISignal,InpPrice,MODE_SIGNAL,i);

            Index_3=iCCi(NULL,TimeFrame_3,InpCCIPeriod,InpCCISignal,InpPrice,MODE_MAIN,i);
            Signal3=iCCi(NULL,TimeFrame_3,InpCCIPeriod,InpCCISignal,InpPrice,MODE_SIGNAL,i); break;
        }

      if(Index_1 gt Signal1)
        {
         IndexBuffer_1A[i] = Index_1;
         IndexBuffer_1B[i] = EMPTY_VALUE;
        }
      else
        {
         IndexBuffer_1B[i] = Index_1;
         IndexBuffer_1A[i] = EMPTY_VALUE;
        }
      SignalBuffer_1[i]=Signal1;

      if(Index_2 gt Signal2)
        {
         IndexBuffer_2A[j] = Index_2;
         IndexBuffer_2B[j] = EMPTY_VALUE;
        }
      else
        {
         IndexBuffer_2B[j] = Index_2;
         IndexBuffer_2A[j] = EMPTY_VALUE;
        }
      SignalBuffer_2[j]=Signal2;

      if(Index_3 gt Signal3)
        {
         IndexBuffer_3A[k] = Index_3;
         IndexBuffer_3B[k] = EMPTY_VALUE;
        }
      else
        {
         IndexBuffer_3B[k] = Index_3;
         IndexBuffer_3A[k] = EMPTY_VALUE;
        }
      SignalBuffer_3[k]=Signal3;
      //--- done
     }
   return(rates_total);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
const bool NewBar(const datetime& time)
  {
   static datetime time_prev;
   if(time_prev!=time)
     {
      time_prev=time;
      return(true);
     }
   return(false);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
const double iMacd(const string symbol,
                   const ENUM_TIMEFRAMES timeframe,
                   const int fastema,
                   const int slowema,
                   const int signalsma,
                   const ENUM_APPLIED_PRICE price,
                   const int mode,
                   const int idx)
  {
   double macd;
   int deci;
   if(_Digits==2 || _Digits==3) deci=100;
   else                         deci=10000;
   if(_Symbol=="XAUUSD")        deci=10;
   macd=deci*iMACD(symbol,timeframe,fastema,slowema,signalsma,price,mode,idx);
   return(macd);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
const double iStoch(const string symbol,
                    const ENUM_TIMEFRAMES timeframe,
                    const int kperiod,
                    const int dperiod,
                    const int slowing,
                    const int pricefield,
                    const int mode,
                    const int idx)
  {
   double stoch;
   stoch=iStochastic(symbol,timeframe,kperiod,dperiod,slowing,MODE_SMA,pricefield,mode,idx)-50;
   return(stoch);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
const double iRSi(const string symbol,
                  const ENUM_TIMEFRAMES timeframe,
                  const int period,
                  const int signal,
                  const ENUM_APPLIED_PRICE price,
                  const int mode,
                  const int idx)
  {
   double rsi;
   if(mode==MODE_SIGNAL)
     {
      double rsisignal[1];
      ArrayResize(rsisignal,signal);
      double sum=0.0;
      for(int i=0;i lt signal;i++)
        {
         rsisignal[i]=iRSI(symbol,timeframe,period,price,idx+i)-50;
         sum+=rsisignal[i];
        }
      rsi=sum/signal;
     }
   else
      rsi=iRSI(symbol,timeframe,period,price,idx)-50;

   return(rsi);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
const double iCCi(const string symbol,
                  const ENUM_TIMEFRAMES timeframe,
                  const int period,
                  const int signal,
                  const ENUM_APPLIED_PRICE price,
                  const int mode,
                  const int idx)
  {
   double cci;
   double mul=1.5/period;
   if(mode==MODE_SIGNAL)
     {
      double ccisignal[1];
      ArrayResize(ccisignal,signal);
      double sum=0.0;
      for(int i=0;i lt signal;i++)
        {
         ccisignal[i]=iCCI(symbol,timeframe,period,price,idx+i)*mul;
         sum+=ccisignal[i];
        }
      cci=sum/signal;
     }
   else
      cci=iCCI(symbol,timeframe,period,price,idx)*mul;

   return(cci);
  }
//+------------------------------------------------------------------+

 

About Me

I'm Mike Semlitsch the owner of PerfectTrendSystem.com. My trading career started in 2007. Since 2013 I have helped thousands of traders to take their trading to the next level. Many of them are now constantly profitable traders. 

The following performance was achieved by me while trading live in front of hundreds of my clients:

Connect With Me:  

This FREE Indicator Can Transform
Your Trading!

FREE Indicator + Telegram Group


Request the Ultimate Double Top/Bottom Indicator which is used by 10,000+ traders.

Results From 5 Months!
This service starts soon! Be the first who get's notified when it begins!