Author: Copyright � 2008, Sugeng Pudjiono & Associate
HLBolinger
Indicators Used
Bollinger bands indicator
Miscellaneous
Implements a curve of type %1
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 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 ---