Navigation:Home > Content >

MA_Shade_5-25.mq4

Time: 2014-12-26 | Download file:MA_Shade_5-25.mq4

//+------------------------------------------------------------------+
//|                                                     MA_Shade.mq4 |
//|                                                           oromek |
//|                                                [email protected] |
//+------------------------------------------------------------------+
#property copyright "oromek"
#property link      "[email protected]"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Blue
#property indicator_width1 3
#property indicator_width2 3

extern int MA1_Period=5;
extern int MA2_Period=25;
extern string MA_Method_Help="0-SMA, 1-EMA, 2-SMMA, 3-LWMA";
extern int MA_Method=1;

double MA1, MA2;
double MA1_Buffer[], MA2_Buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_DOT);
   SetIndexBuffer(0,MA1_Buffer);
   
   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_DOT);
   SetIndexBuffer(1,MA2_Buffer);
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   
   int limit=Bars-counted_bars;
   if(counted_bars>0) limit++;
   
   for(int i=1; i        

Recommend