Author: Copyright � 2006, Victor Chebotariov
go
Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
go
//+------------------------------------------------------------------+
//|                                                           go.mq4 |
//|                             Copyright © 2006, Victor Chebotariov |
//|                                      http://www.chebotariov.com/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Victor Chebotariov"
#property link      "http://www.chebotariov.com/"

extern int period = 174;
extern int ma_shift = 0;

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 LightSeaGreen
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorShortName("GO");
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Accumulation/Distribution                                        |
//+------------------------------------------------------------------+
int start()
  {
   int i,counted_bars=IndicatorCounted();
//----
   i=Bars-counted_bars-1;
   while(i>=0)
     {
      double high =iMA(NULL,0,period,ma_shift,MODE_SMA,PRICE_HIGH,i);
      double low  =iMA(NULL,0,period,ma_shift,MODE_SMA,PRICE_LOW,i);
      double open =iMA(NULL,0,period,ma_shift,MODE_SMA,PRICE_OPEN,i);
      double close=iMA(NULL,0,period,ma_shift,MODE_SMA,PRICE_CLOSE,i);
       ExtMapBuffer1[i]=((close-open)+(high-open)+(low-open)+(close-low)+(close-high))*Volume[i];
      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 ---