#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Blue
//---- buffers
double Buffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,Buffer1);
SetIndexDrawBegin(0,Buffer1);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
int i, limit;
if(counted_bars>0) counted_bars--;
limit=Bars-IndicatorCounted();
//+------------------------------------------------------------------+
//| DMI.mq4 |
//| Copyright ?2007, MetaQuotes Software Corp. |
//| http://www.MetaQuotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2007, MetaQuotes Software Corp."
#property link "http://www.MetaQuotes.net"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Blue
//---- buffers
double Buffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,Buffer1);
SetIndexDrawBegin(0,Buffer1);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
int i, limit;
if(counted_bars>0) counted_bars--;
limit=Bars-IndicatorCounted();
double aa[];
for(i=0;i<limit;i++)
aa[i]=Close[i]-Close[i+5];
for(i=0;i<limit;i++)
Buffer1[i]=iMAOnArray(aa,Bars,14,0,MODE_SMA,i);
//----
return(0);
}
//+------------------------------------------------------------------+