Author: Copyright � 2006, ������ ��������
MATWO
Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
MATWO
//+------------------------------------------------------------------+
//|                                                        MATWO.mq4 |
//|                               Copyright © 2006, Âèêòîð ×åáîòàð¸â |
//|                                      http://www.chebotariov.com/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Âèêòîð ×åáîòàð¸â"
#property link      "http://www.chebotariov.com/"

extern int PERIOD = 8;

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Gray
#property indicator_color2 Red
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorShortName("MATWO");
//---- indicators
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer2);

//----
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   int i,counted_bars=IndicatorCounted();
//----
   i=Bars-counted_bars-1;

   while(i>=0)
     {
      double MA_Blue = iMA(NULL,0,PERIOD,0,MODE_SMA,PRICE_WEIGHTED,i);
      double MA_Red = iMA(NULL,0,PERIOD,0,MODE_EMA,PRICE_CLOSE,i);
      double MA_Blue2 = iMA(NULL,0,PERIOD*2,0,MODE_SMA,PRICE_WEIGHTED,i);
      double MA_Red2 = iMA(NULL,0,PERIOD*2,0,MODE_EMA,PRICE_CLOSE,i);

      ExtMapBuffer1[i]=((MA_Red2-MA_Blue2)+(MA_Red-MA_Blue))*1000000;
      ExtMapBuffer2[i]=(MA_Red-MA_Blue)*1000000;
      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 ---