Indicators Used
Miscellaneous
0
Views
0
Downloads
0
Favorites
HLBolinger
//+--------------------------------------------------------------------+
//| HLBolinger.mq4 |
//| Copyright © 2008, Sugeng Pudjiono & Associate |
//| http://www.payroll-kita.com/ |
//+--------------------------------------------------------------------+
#property copyright "Copyright © 2008, Sugeng Pudjiono & Associate"
#property link "http://www.payroll-kita.com/"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 LightBlue
#property indicator_color2 LightBlue
extern double TPeriod=24,TStd=2,BPeriod=24,BStd=2;
//---- indicator buffers
double TBuffer[];
double BBuffer[];
int limit;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
SetIndexShift(0,0);
SetIndexDrawBegin(0,0);
SetIndexBuffer(0,TBuffer);
SetIndexStyle(0,DRAW_LINE,0,1);
SetIndexLabel(0,"Top");
SetIndexShift(1,0);
SetIndexDrawBegin(1,0);
SetIndexBuffer(1,BBuffer);
SetIndexStyle(1,DRAW_LINE,0,1);
SetIndexLabel(1,"Bottom");
return(0);
}
int deinit()
{
GlobalVariablesDeleteAll();
return(0);
}
//+----------------------+
//| H/L Bollinger Bands |
//+----------------------+
int start()
{
int counted_bars=IndicatorCounted();
limit=Bars-counted_bars;
if(counted_bars>0) limit++;
for(int i=limit; i>-1; i--)
{
TBuffer[i]=iBands(NULL,0,TPeriod,TStd,0,PRICE_HIGH,MODE_UPPER,i);
BBuffer[i]=iBands(NULL,0,BPeriod,BStd,0,PRICE_LOW ,MODE_LOWER,i);
}
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
---