Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
2 Views
0 Downloads
0 Favorites
BvsB
#property  copyright "BECEMAL"
#property  link      "http://www.becemal.ru/mql"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red

extern int BBPeriod=14;

double BearsBuff[];
double BullsBuff[];

int init()  {
IndicatorShortName("BvsB("+BBPeriod+")");
SetIndexBuffer(0,BearsBuff);
SetIndexBuffer(1,BullsBuff);
SetIndexStyle(0,DRAW_LINE);
SetIndexStyle(1,DRAW_LINE);
SetIndexLabel(0,"Bears");
SetIndexLabel(1,"Bulls");
return(0);  }

int start() {
int counted_bars=IndicatorCounted();
if(Bars<=BBPeriod) return(0);
int limit=Bars-counted_bars-1;
if(limit < 2) limit = 2;
for(int  i = limit;i >= 0;i--)   {
   double   SMMA = iMA(NULL,0,BBPeriod,0,MODE_SMMA,PRICE_CLOSE,i);
   BearsBuff[i] = SMMA - Low[i];
   BullsBuff[i] = High[i]-SMMA;  }
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 ---