Author: Copyright c 2008, codobro
The-Wave
Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
The-Wave
//+------------------------------------------------------------------+
//|                                                     The-Wave.mq4 |
//|                                         "The Wave" indicator :)  |
//|                                         Copyright c 2008 codobro |
//+------------------------------------------------------------------+
#property copyright "Copyright c 2008, codobro"
#property link      "http://www.metaquotes.net"

#property indicator_chart_window

#property indicator_buffers 3
#property indicator_color1 Aqua
#property indicator_color2 Aqua
#property indicator_color3 Aqua

extern int  WavePeriod  =  34;
extern int  Method      =  1;
extern int  TimeFrame   =  0;

double   W1[];
double   W2[];
double   W3[];
//+-----
int init()
  {
//---- indicators
   IndicatorBuffers(3);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(0,W1);
   SetIndexBuffer(1,W2);
   SetIndexBuffer(2,W3);
//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    limit,i;
   int    counted_bars=IndicatorCounted();
//--last bar will be recounted;
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;

   for(i=0; i<limit; i++)   
   W1[i]=iMA(NULL,TimeFrame,WavePeriod,0,Method,PRICE_HIGH,i);
   for(i=0; i<limit; i++)
   W2[i]=iMA(NULL,TimeFrame,WavePeriod,0,Method,PRICE_CLOSE,i);
   for(i=0; i<limit; i++)   
   W3[i]=iMA(NULL,TimeFrame,WavePeriod,0,Method,PRICE_LOW,i);

//----
   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 ---