[i]MovingMedian

Author: Ron Thompson
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
[i]MovingMedian
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+-------------------------+
//| Moving Median indicator |
//+-------------------------+
#property copyright "Ron Thompson"
#property link      "http://www.lightpatch.com/forex/"

#property indicator_chart_window
#property indicator_buffers 1

#property indicator_color1 Red

// User Input
extern int MedianPeriods = 21;


//---- buffers
double Buffer0[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//|------------------------------------------------------------------|

int init()
  {

   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0, Buffer0);
   
  }


//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
  }


//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+


int start()
  {
   int      pos=Bars-(MedianPeriods*2); // leave room for moving median periods
   int      ctr=0;

   while(pos>=0)
     {
      for(ctr=MedianPeriods; ctr>=0; ctr--)
        {
        }



      Buffer0[pos]=ma0; 

      
 	   pos--;
     }

   return(0);
  }
//+------------------------------------------------------------------+

Comments