MFCS ATR BAR

Author: Copyright � 2009, MFCS
Indicators Used
Indicator of the average true range
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
MFCS ATR BAR
//+------------------------------------------------------------------+
//|                                                 MFCS ATR BAR.mq4 |
//|                                           Copyright © 2009, MFCS |
//|                                     http://www.mpatidar.com/mfcs |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MFCS"
#property link      "http://www.mpatidar.com/mfcs"
#property copyright "Copyright © 2009, MFCS"
#property link      "http://www.mpatidar.com/mfcs"

#property  indicator_separate_window
#property  indicator_buffers 1
#property  indicator_color1  Silver
#property  indicator_width1  4


//---- indicator parameters
extern int _Period=5;


double     SwBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- drawing settings
   SetIndexStyle(0,DRAW_HISTOGRAM);   
   IndicatorDigits(0);
//---- indicator buffers mapping
   SetIndexBuffer(0,SwBuffer);
   
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("MFCS ATR BAR(" + _Period + ")");
   SetIndexLabel(0,"ATR");
   
   SetIndexEmptyValue(0,0.0);   
   
//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence                           |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars-=1;
   limit=Bars-counted_bars;
//---- macd counted in the 1-st buffer
   for(int i=0; i<limit; i++)
   {
      
      SwBuffer[i] = NormalizeDouble(iATR(Symbol(), Period(), _Period, i) / Point, 0);
      
      
   }
   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 ---