zscore





//+------------------------------------------------------------------+
//|                                                       zscore.mq4 |
//|                                                        modulatum |
//+------------------------------------------------------------------+
#property copyright "Mod"

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 DeepSkyBlue
#property indicator_level1 0
//---- input parameters
extern int       barsToCount = 2000;
//---- buffers
double zscore[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorBuffers(1);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,zscore);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int limit = barsToCount;
   
//----
   
   for(int i = 0 ;i <= limit-20 ;i++)
   {  
      
      zscore[i] = (iClose(NULL,0,i)-iMA(NULL,0,60,0,0,0,i))/iStdDev(NULL,0,60,0,0,0,i);  
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:

Series array that contains close prices for each bar


Indicator Curves created:

Implements a curve of type DRAW_LINE


Indicators Used:

Moving average indicator
Standard Deviation indicator


Custom Indicators Used:

Order Management characteristics:

Other Features: