DIDI Index MQL conversion

Indicators coded by community members
Message
Author
andreforex
Posts: 3
Joined: Sun Nov 17, 2013 10:12 pm

DIDI Index MQL conversion

#1 Postby andreforex » Fri May 20, 2016 12:16 am

This indicator is used tipically to find reversion in a trend market, does not work on range/sideways.

Code: Select all

#property copyright "DiDi Index Use on M15/M5 trend "
#property link      ""

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red

#property indicator_level1 0.0
#property indicator_levelcolor Black
#property indicator_levelwidth 1
#property indicator_levelstyle STYLE_SOLID





//---- input parameters

extern int       didi_ema1=3;
extern int       didi_ema2=8;
extern int       didi_ema3=20;
extern int       didi_ema4=8;

//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer2);


   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
 


int start()
{
   int    counted_bars=IndicatorCounted();
   
   //---- check for possible errors
   if(counted_bars<0) return(-1);
  //---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   int limit=Bars-counted_bars;
   for(int i=0;i<limit;i++)
   {
      double dif1 = iMA(Symbol(),0,didi_ema1,0,MODE_SMA,PRICE_CLOSE,i)-
                 iMA(Symbol(),0,didi_ema2,0,MODE_SMA,PRICE_CLOSE,i);
      double dif2 = iMA(Symbol(),0,didi_ema3,0,MODE_SMA,PRICE_CLOSE,i)-
                 iMA(Symbol(),0,didi_ema4,0,MODE_SMA,PRICE_CLOSE,i);                         
      ExtMapBuffer1[i]=dif1;
      ExtMapBuffer2[i]=dif2;     
   }   
   return(0);

}
//+------------------------------------------------------------------+

jfdelosrios
Posts: 34
Joined: Sat Feb 13, 2016 6:26 am

Re: DIDI Index MQL conversion

#2 Postby jfdelosrios » Mon Aug 08, 2016 10:18 am

I can help you.

jfdelosrios@hotmail.com
my whatsapp +57 315 860 06 19


Return to “Indicators”

Who is online

Users browsing this forum: No registered users and 28 guests