Candles_Ratio_v1

Author: Copyright � 2010, Vladimir Hlystov
Candles_Ratio_v1
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
Candles_Ratio_v1
//+------------------------------------------------------------------+
//|                                                Candles_Ratio.mq4 |
//|                               Copyright © 2010, Vladimir Hlystov |
//|                                         http://cmillion.narod.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, Vladimir Hlystov"
#property link      "WWW: http://cmillion.narod.ru  MAIL: cmillion@narod.ru"

#property indicator_separate_window
#property indicator_buffers    1
#property indicator_color1     Green
//+------------------------------------------------------------------+
extern int PeriodCN = 20;
double K[];
//+------------------------------------------------------------------+
int init()
  {
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,K);
   return(0);
  }
//+------------------------------------------------------------------+
int start()
  {
   int limit=Bars-IndicatorCounted();
   ObjectDelete("startline");
   ObjectCreate("startline",OBJ_VLINE,0, Time[PeriodCN],0,0,0,0,0);
   ObjectSet   ("startline", OBJPROP_COLOR, Green);
   for(int n=0; n<limit; n++)
   {
      double B=0,M=0;
      for (int j = n; j<PeriodCN+n; j++) 
      { 
         if (Open[j]<Close[j]) B += Close[j]-Open[j]; 
         else                  M += Open[j]-Close[j]; 
      }
      K[n] = B / M;
   }
   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 ---