MA_separation_P





//http://www.kroufr.ru/forum/index.php/topic,7500.0.html#msg47579
//separation [quote =alexav link=topic=7500.msg47579#msg47579 date=1219499958]

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Green
#property indicator_levelcolor Red
#property indicator_levelstyle STYLE_DOT
#property indicator_level1 8
#property indicator_level2 -8
//#property indicator_minimum -20
//#property indicator_maximum 20

//---- buffers
double IND[];
extern int MAPeriod1=10;
extern int Mode1=1;
extern int Price1=0;

extern int MAPeriod2=24;
extern int Mode2=1;
extern int Price2=0;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorShortName("MA("+MAPeriod1+","+MAPeriod2+") Separation Points:");
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,IND);
//----

   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
     int limit;
     int counted_bars=IndicatorCounted();
     if(counted_bars<0) return(-1);
     if(counted_bars>0) counted_bars--;
     limit=Bars-counted_bars;



     for(int i=0; i<limit; i++)
       {
        IND[i]=(iMA(NULL,0,MAPeriod1,0,Mode1,Price1,i)-iMA(NULL,0,MAPeriod2,0,Mode2,Price2,i))*1/Point;
       }
  //----
    return(0);
  }
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:



Indicator Curves created:

Implements a curve of type DRAW_LINE


Indicators Used:

Moving average indicator


Custom Indicators Used:

Order Management characteristics:

Other Features: