Indicators Used
Miscellaneous
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 Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---