Bulls Bears Power

Author: vasbsm@mail.ru
Bulls Bears Power
Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
Bulls Bears Power
//+------------------------------------------------------------------+
//|                                            Bulls Bears Power.mq4 |
//|                                                   vasbsm@mail.ru |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "vasbsm@mail.ru"
#property link      ""

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Silver
//---- input parameters
extern int       BBPeriod=155;
extern int       TypeMA=0;
//-----------------------------
double BBBuffer[];
double TempBuffer[];
int init()
  {
   string short_name;
   IndicatorBuffers(2);
   IndicatorDigits(Digits);
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(0,BBBuffer);
   SetIndexBuffer(1,TempBuffer); 
   short_name="Bulls Bears Power("+BBPeriod+")";     
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);   
   return(0);
  }
int deinit()
  {

   return(0);
  }
int start()
  {
   int counted_bars=IndicatorCounted();
   if(Bars<=BBPeriod) return(0);
//----------------------------------------------------------------
   int limit=Bars-counted_bars;
   if(counted_bars>0) limit++;
   for(int i=0; i<limit; i++)
      TempBuffer[i]=iMA(NULL,0,BBPeriod,0,TypeMA,PRICE_CLOSE,i);
//----------------------------------------------------------------
   i=Bars-counted_bars-1;
   while(i>=0)
     {
      BBBuffer[i]=High[i]+Low[i]-2*TempBuffer[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 ---