[i]MovingMedian_v1

Author: Ron Thompson
Miscellaneous
Implements a curve of type %1
2 Views
0 Downloads
0 Favorites
[i]MovingMedian_v1
//+-------------------------+
//| 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

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---